/* ============================================================
   PWA DISCOVERY — DESIGN SYSTEM
   ============================================================ */

:root {
  --blue:       #2563EB;
  --blue-dark:  #1D4ED8;
  --blue-light: #DBEAFE;
  --green:      #10B981;
  --red:        #EF4444;
  --red-light:  #FEE2E2;
  --orange:     #F59E0B;
  --gray-50:    #F8FAFC;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --gray-300:   #CBD5E1;
  --gray-400:   #94A3B8;
  --gray-500:   #64748B;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1E293B;
  --gray-900:   #0F172A;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.10);
  --header-h:   64px;
  --footer-h:   76px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: var(--blue); }

/* ---- HEADER ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex: 1;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-900);
  letter-spacing: -.3px;
}
.header-right { display: flex; align-items: center; gap: 10px; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  transition: all .15s;
}
.lang-btn:hover { border-color: var(--blue); color: var(--blue); }

.mode-badge {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

.step-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  min-width: 40px;
  text-align: right;
}

.progress-track {
  height: 3px;
  background: var(--gray-200);
}
.progress-fill {
  height: 100%;
  background: var(--blue);
  transition: width .4s cubic-bezier(.4,0,.2,1);
  border-radius: 0 2px 2px 0;
}

/* ---- RESUME BANNER ---- */
.resume-banner {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--blue);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 90;
  flex-wrap: wrap;
  font-size: 14px;
}
.resume-actions { display: flex; gap: 8px; }
.btn-resume-yes, .btn-resume-no {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.btn-resume-yes { background: #fff; color: var(--blue); }
.btn-resume-no { background: rgba(255,255,255,.2); color: #fff; }

/* ---- MAIN ---- */
.main {
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: calc(var(--footer-h) + 24px);
  min-height: 100dvh;
}

/* ---- STEP CONTAINER ---- */
.step-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
  animation: fadeSlide .3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- SECTION HEADER ---- */
.section-header {
  margin-bottom: 28px;
}
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  margin-bottom: 12px;
}
.section-icon { font-size: 16px; }
.section-num  { font-size: 11px; opacity: .8; }
.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.25;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.section-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ---- QUESTION CARD ---- */
.question {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.question:focus-within { border-color: var(--blue); }
.question.is-important {
  border-left: 3px solid var(--red);
}

.q-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.q-label-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
  flex: 1;
}
.q-important-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  background: var(--red-light);
  color: var(--red);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-top: 2px;
}
.q-optional-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  margin-top: 2px;
}
.q-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 10px;
  margin-top: -6px;
  font-style: italic;
}

/* ---- INPUTS ---- */
.input-text, .input-email, .input-tel, .input-url, .input-textarea, .input-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input-text:focus, .input-email:focus, .input-tel:focus,
.input-url:focus, .input-textarea:focus, .input-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.input-text::placeholder, .input-email::placeholder,
.input-tel::placeholder, .input-url::placeholder,
.input-textarea::placeholder { color: var(--gray-400); }
.input-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }

/* ---- RADIO ---- */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.radio-option:hover { border-color: var(--blue); background: var(--blue-light); }
.radio-option.selected { border-color: var(--blue); background: var(--blue-light); }
.radio-option input[type="radio"] { display: none; }
.radio-dot {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.radio-option.selected .radio-dot {
  border-color: var(--blue);
  background: var(--blue);
}
.radio-option.selected .radio-dot::after {
  content: '';
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
}
.radio-label { font-size: 14px; color: var(--gray-700); flex: 1; }

/* ---- CHECKBOX ---- */
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.checkbox-option:hover { border-color: var(--blue); background: var(--blue-light); }
.checkbox-option.selected { border-color: var(--blue); background: var(--blue-light); }
.checkbox-option input[type="checkbox"] { display: none; }
.checkbox-box {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.checkbox-option.selected .checkbox-box {
  border-color: var(--blue);
  background: var(--blue);
}
.checkbox-option.selected .checkbox-box::after {
  content: '';
  width: 10px; height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.checkbox-label { font-size: 14px; color: var(--gray-700); flex: 1; }

/* ---- SCALE ---- */
.scale-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.scale-btn {
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  transition: all .15s;
}
.scale-btn:hover { border-color: var(--blue); color: var(--blue); }
.scale-btn.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ---- REQUIRED INDICATOR ---- */
.required-star { color: var(--red); margin-left: 3px; }

/* ---- VALIDATION ---- */
.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.input-text.invalid, .input-email.invalid,
.input-textarea.invalid { border-color: var(--red); }

/* ---- NAV FOOTER ---- */
.nav-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  height: var(--footer-h);
}
.nav-center { flex: 1; display: flex; justify-content: center; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; max-width: 160px; }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: all .2s;
}
.dot.active { background: var(--blue); width: 18px; border-radius: 3px; }
.dot.done { background: var(--green); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--gray-400); color: var(--gray-700); }
.btn-submit {
  background: var(--green);
  color: #fff;
  padding: 12px 28px;
}
.btn-submit:hover { background: #059669; transform: translateY(-1px); box-shadow: var(--shadow); }

/* ---- CENTERED VIEWS ---- */
.centered-view {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100dvh - var(--header-h));
  justify-content: center;
}

/* ---- SPINNER ---- */
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- THANK YOU ---- */
.thankyou-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
}
.thankyou-icon { margin-bottom: 20px; }
.thankyou-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.thankyou-card p { color: var(--gray-500); margin-bottom: 24px; }

.ty-summary {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 20px;
  width: 100%;
}
.ty-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-200);
}
.ty-summary-row:last-child { border-bottom: none; }
.ty-summary-label { color: var(--gray-500); font-weight: 500; }
.ty-summary-value { color: var(--gray-800); font-weight: 600; text-align: right; max-width: 60%; }
.ty-note { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }

/* ---- ERROR ---- */
.error-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
}
.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.error-card p { color: var(--gray-500); margin-bottom: 24px; font-size: 14px; }

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .section-title { font-size: 22px; }
  .btn { padding: 9px 16px; font-size: 13px; }
  .thankyou-card, .error-card { padding: 28px 20px; }
  .dots { max-width: 120px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .header, .nav-footer, .resume-banner { display: none !important; }
  .main { padding-top: 0; padding-bottom: 0; }
  .step-container { max-width: 100%; padding: 0; }
  .question {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 10px;
  }
  .section-header { break-after: avoid; }
  body { background: #fff; color: #000; }
}
