/* LNA Survey — Domino's Pizza Japan visual language.
 *
 * Brand palette observed from DPJ web properties:
 *   red    #E21836  (primary CTAs, accents)
 *   blue   #007AAF  (secondary CTAs, links)
 *   white  #FFFFFF  (page surface)
 *   ink    #1A1A1A  (body text)
 *   slate  #2A2A2A  (top navigation band)
 *
 * Typography:
 *   Oswald (500–700)  → condensed bold display / section headings (Futura Condensed substitute)
 *   Inter (400–800)   → body, controls
 *   Noto Sans JP      → CJK fallback at all weights
 *
 * No external CSS — designed and implemented for this survey from scratch.
 */

:root {
  --dpj-red:        #E21836;
  --dpj-red-dark:   #b91428;
  --dpj-blue:       #007AAF;
  --dpj-blue-dark:  #005d86;
  --dpj-yellow:     #FFCB05;
  --ink:            #1A1A1A;
  --ink-2:          #374151;
  --muted:          #6B7280;
  --line:           #E5E7EB;
  --line-strong:    #D1D5DB;
  --bg:             #FAFAF7;
  --paper:          #FFFFFF;
  --slate:          #2A2A2A;
  --slate-2:        #3D3D3D;
  --soft:           #F5F5F0;
  --good:           #059669;
  --warn:           #D97706;
  --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:      0 6px 18px rgba(0,0,0,0.08);
  --shadow-lg:      0 12px 32px rgba(0,0,0,0.12);

  --font-display:   'Oswald', 'Noto Sans JP', system-ui, sans-serif;
  --font-body:      'Inter', 'Noto Sans JP', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--dpj-red); color: white; }

/* ============================================================
   Top navigation band — dark, full-bleed, logo + eyebrow label.
   ============================================================ */
.brand-bar {
  background: var(--slate);
  color: white;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.2));
}
.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.18);
  flex: 0 0 auto;
}
.brand-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .brand-bar { padding: 10px 16px; }
  .brand-eyebrow { display: none; }
  .brand-divider { display: none; }
  .brand-logo { height: 28px; }
}

/* Red/blue accent strip below the dark band — DPJ signature look */
.brand-accent {
  height: 4px;
  background: linear-gradient(90deg,
    var(--dpj-red)   0%,
    var(--dpj-red)   60%,
    var(--dpj-blue) 60%,
    var(--dpj-blue) 100%);
}

/* ============================================================
   Language toggle (pill pair in the nav band)
   ============================================================ */
.lang-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.18);
  flex: 0 0 auto;
}
.lang-btn {
  background: transparent;
  color: rgba(255,255,255,0.78);
  border: 0;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-btn:hover { color: white; }
.lang-btn.active {
  background: white;
  color: var(--slate);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ============================================================
   Page container + screen primitives
   ============================================================ */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
main.screen {
  display: none;
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 120px;
}
main.screen.active { display: block; }

footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 18px 24px 40px;
  margin-top: 30px;
  text-align: center;
}
footer p {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   Headings
   ============================================================ */
h1.title, h2.title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-transform: uppercase;
}
h1.title {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  margin-bottom: 16px;
}
h2.title {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  margin-bottom: 22px;
}
h1.title::after, h2.title::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  background: var(--dpj-red);
  margin-top: 10px;
}

/* ============================================================
   Welcome screen — cover letter body + meta facts + CTA
   ============================================================ */
.cover-body p {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.welcome-meta {
  margin: 30px 0 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--dpj-red);
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.meta-row:last-child { border-bottom: 0; }
.meta-row > span:first-child {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 12px;
}
.meta-row b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.large { padding: 16px 28px; font-size: 18px; min-height: 56px; }
.btn.primary {
  background: var(--dpj-red);
  color: white;
  box-shadow: 0 2px 0 var(--dpj-red-dark);
}
.btn.primary:hover {
  background: var(--dpj-red-dark);
  box-shadow: 0 1px 0 var(--dpj-red-dark);
}
.btn.primary:disabled,
.btn.primary[disabled] {
  background: var(--line-strong);
  color: white;
  box-shadow: none;
  cursor: not-allowed;
}
.btn.secondary {
  background: var(--dpj-blue);
  color: white;
  box-shadow: 0 2px 0 var(--dpj-blue-dark);
}
.btn.secondary:hover { background: var(--dpj-blue-dark); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover { background: var(--soft); }

#begin-btn { margin-top: 6px; }

/* ============================================================
   Survey screen — identifier card
   ============================================================ */
.id-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.id-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--dpj-red) 0%, var(--dpj-red) 60%, var(--dpj-blue) 60%, var(--dpj-blue) 100%);
}
.id-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--dpj-red);
}
.id-note {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 60ch;
}
.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) { .id-grid { grid-template-columns: 1fr; } }
.id-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.id-grid label span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.id-grid input {
  width: 100%;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.id-grid input:focus {
  outline: none;
  border-color: var(--dpj-red);
  box-shadow: 0 0 0 3px rgba(226,24,54,0.12);
}

/* ============================================================
   Scale legend
   ============================================================ */
.scale-legend {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--dpj-blue);
  border-radius: 10px;
  padding: 16px 22px 12px;
  margin-bottom: 22px;
}
.legend-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  line-height: 1.35;
}
.legend-end:first-child { text-align: left; }
.legend-end:last-child  { text-align: right; }
.legend-nums {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-2);
  text-align: center;
}
.legend-nums span:nth-child(3) { color: var(--dpj-blue); }

/* ============================================================
   Section card with header bar
   ============================================================ */
.section-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 0 8px;
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 10px 30px 12px;
}
.section-card .validity-note {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  padding: 0 30px 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 2px;
  max-width: 70ch;
}
.section-card .section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: white;
  background: var(--dpj-red);
  padding: 6px 14px;
  border-radius: 4px;
  margin: 22px 30px 0;
}
.section-card .section-label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
}

/* ============================================================
   Question rows + sliders
   ============================================================ */
.question {
  padding: 18px 30px;
  border-top: 1px solid var(--line);
}
.section-card .section-label + h3 + .question,
.section-card .question:first-of-type { border-top: 1px solid var(--line); }
.qtext {
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.55;
}
.question:not(.touched) .qtext { color: var(--ink-2); }

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.slider-row input[type="range"] {
  flex: 1 1 auto;
  appearance: none; -webkit-appearance: none;
  height: 8px;
  background: linear-gradient(90deg, #fee2e2 0%, #fef9c3 50%, #dcfce7 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
}
.slider-row input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 999px; background: transparent;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px;
  background: white;
  border: 3px solid var(--dpj-red);
  border-radius: 50%;
  margin-top: -9px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: grab;
  transition: transform .1s ease;
}
.slider-row input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
.slider-row input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  background: white;
  border: 3px solid var(--dpj-red);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: grab;
}
.question:not(.touched) .slider-row input[type="range"]::-webkit-slider-thumb {
  border-color: var(--line-strong);
  background: #f3f4f6;
}
.question:not(.touched) .slider-row input[type="range"]::-moz-range-thumb {
  border-color: var(--line-strong);
  background: #f3f4f6;
}

/* ============================================================
   Slider value box — number + label
   ============================================================ */
.slider-value {
  flex: 0 0 auto;
  min-width: 200px; max-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  line-height: 1.15;
}
.slider-value .sv-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--dpj-red);
  flex: 0 0 auto;
  line-height: 1;
}
.slider-value .sv-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.005em;
}
.question:not(.touched) .slider-value {
  background: transparent;
  border-style: dashed;
  justify-content: center;
  color: var(--muted);
}
.question:not(.touched) .slider-value::after {
  content: '—';
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--line-strong);
}
@media (max-width: 720px) {
  .slider-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .slider-value { min-width: 0; max-width: none; justify-content: center; }
  .question { padding: 18px 20px; }
  .section-card h3 { padding-left: 20px; padding-right: 20px; }
  .section-card .section-label { margin-left: 20px; margin-right: 20px; }
  .section-card .validity-note { padding-left: 20px; padding-right: 20px; }
  .id-card { padding: 22px 20px; }
}

/* ============================================================
   Sticky submit bar
   ============================================================ */
.submit-bar {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 2px solid var(--dpj-red);
  margin: 20px -24px -120px;
  padding: 18px 24px 28px;
  box-shadow: 0 -6px 18px rgba(0,0,0,0.06);
  z-index: 5;
}
.progress-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}
#submit-btn { width: 100%; }

/* ============================================================
   Thank-you / error screens
   ============================================================ */
.thanks-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 60px 40px;
  text-align: center;
  margin: 30px 0;
  box-shadow: var(--shadow-sm);
}
.check-mark {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--dpj-red);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(226,24,54,0.3);
}
.check-mark.error { background: var(--warn); box-shadow: 0 4px 16px rgba(217,119,6,0.3); }
.thanks-card h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.thanks-card p {
  color: var(--ink-2);
  margin-bottom: 8px;
}
.thanks-card .thanks-subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: -4px;
  margin-bottom: 22px;
}
.thanks-card .thanks-translation {
  font-size: 14px;
  color: var(--muted);
  margin-top: -2px;
  margin-bottom: 14px;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.thanks-card .error-detail {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--soft);
  padding: 8px 14px;
  border-radius: 6px;
  margin: 14px auto 18px;
  display: inline-block;
}
.thanks-card .error-detail:empty {
  display: none;
}
.receipt-line {
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
}
.receipt-line .mono {
  font-family: var(--font-mono);
  background: var(--soft);
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 600;
}
