/* psychometric-styles.css — Full theme + responsive for all screen sizes */

/* ── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  --primary: #1B4D8C;
  --primary-light: #2563EB;
  --secondary: #E8790B;
  --gold: #F4A300;
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-card: rgba(255,255,255,0.04);
  --surface: rgba(255,255,255,0.06);
  --surface-hover: rgba(255,255,255,0.10);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --border-color: rgba(255,255,255,0.10);
  --glass-bg: rgba(255,255,255,0.05);
  --glass-blur: 20px;
  --input-bg: rgba(255,255,255,0.06);
  --input-text: #F1F5F9;
  --select-bg: #1a2035;
  --font: 'Inter', sans-serif;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.16,1,0.3,1);
  --shadow-card: 0 25px 70px rgba(0,0,0,.45);
}

/* ── LIGHT MODE — all variables explicitly overridden ───────────────────────── */
[data-theme="light"] {
  --bg-primary: #F0F4FF;
  --bg-secondary: #FFFFFF;
  --bg-card: rgba(255,255,255,0.85);
  --surface: rgba(0,0,0,0.04);
  --surface-hover: rgba(0,0,0,0.08);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --border-color: rgba(0,0,0,0.10);
  --glass-bg: rgba(255,255,255,0.80);
  --input-bg: #FFFFFF;
  --input-text: #0F172A;
  --select-bg: #FFFFFF;
  --shadow-card: 0 20px 60px rgba(0,0,0,.12);
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-family: var(--font); -webkit-font-smoothing: antialiased; font-size: 16px; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* ── Background Orbs ────────────────────────────────────────────────────────── */
.bg-orb { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; transition: opacity .4s; }
.bg-orb-1 { width: min(450px,90vw); height: min(450px,90vw); background: rgba(27,77,140,0.28); top: -120px; left: -120px; }
.bg-orb-2 { width: min(380px,70vw); height: min(380px,70vw); background: rgba(232,121,11,0.18); bottom: -100px; right: -100px; }
.bg-orb-3 { width: min(300px,60vw); height: min(300px,60vw); background: rgba(124,58,237,0.12); top: 40%; left: 50%; transform: translateX(-50%); }
[data-theme="light"] .bg-orb-1 { background: rgba(27,77,140,0.10); }
[data-theme="light"] .bg-orb-2 { background: rgba(232,121,11,0.08); }
[data-theme="light"] .bg-orb-3 { background: rgba(124,58,237,0.05); }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
}
[data-theme="light"] .navbar { background: rgba(255,255,255,0.7); }

.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.nav-logo-name { font-weight: 700; font-size: .92rem; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--text-secondary);
  transition: all .2s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary); color: white; }
[data-theme="dark"]  .fa-sun  { display: none; }
[data-theme="light"] .fa-moon { display: none; }

.nav-back {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-color);
  font-size: .80rem; font-weight: 600; color: var(--text-secondary);
  transition: all .2s; white-space: nowrap;
}
.nav-back:hover { background: var(--surface-hover); color: var(--text-primary); }

/* ── Page Layout ────────────────────────────────────────────────────────────── */
.page-container {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px 60px;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.psych-card {
  width: 100%; max-width: 560px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: 26px;
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  animation: slideUp .6s var(--ease) both;
}
[data-theme="light"] .psych-card { background: rgba(255,255,255,0.85); }

@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ── Card Header ────────────────────────────────────────────────────────────── */
.card-header { text-align: center; margin-bottom: 26px; }
.card-header-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, #E8790B, #F4A300);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(232,121,11,.4);
}
.card-header h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.card-header p { font-size: .87rem; color: var(--text-secondary); line-height: 1.65; }

/* ── Step Indicators ────────────────────────────────────────────────────────── */
.steps { display: flex; align-items: center; margin-bottom: 22px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 14px;
  left: calc(50% + 17px); right: calc(-50% + 17px);
  height: 2px; background: var(--border-color); z-index: 0; transition: background .4s;
}
.step.completed:not(:last-child)::after { background: var(--primary-light); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; z-index: 1;
  border: 2px solid var(--border-color); background: var(--surface); color: var(--text-tertiary);
  transition: all .3s var(--ease);
}
.step.active .step-dot  { border-color: var(--secondary); background: rgba(232,121,11,.15); color: var(--secondary); box-shadow: 0 0 0 4px rgba(232,121,11,.15); }
.step.completed .step-dot { border-color: var(--primary-light); background: var(--primary-light); color: #fff; }
.step-label { font-size: .60rem; font-weight: 600; color: var(--text-tertiary); text-align: center; white-space: nowrap; }
.step.active    .step-label { color: var(--secondary); }
.step.completed .step-label { color: var(--primary-light); }

/* ── Progress Bar ───────────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--surface); border-radius: 99px; height: 6px; overflow: hidden; margin: 0 0 22px; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-light), var(--secondary)); transition: width .6s var(--ease); }

/* ── Form Panels ────────────────────────────────────────────────────────────── */
.form-panel { display: none; }
.form-panel.active { display: block; }

/* ── Input Groups ───────────────────────────────────────────────────────────── */
.input-group { margin-bottom: 15px; }
.input-group label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  letter-spacing: .5px; text-transform: uppercase;
}
.input-field { position: relative; }
.input-field i.field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); font-size: .82rem; pointer-events: none;
}
.input-field input,
.input-field select {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 13px 11px 38px;
  font-size: .88rem;
  color: var(--input-text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s, color .3s;
  -webkit-appearance: none;
  font-family: var(--font);
}
.input-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  background-color: var(--select-bg);
  padding-right: 34px; cursor: pointer;
}
/* Light mode select — explicit colours so browser default style is overridden */
[data-theme="light"] .input-field select,
[data-theme="light"] .input-field select option { color: #0F172A; background: #FFFFFF; }
[data-theme="dark"]  .input-field select,
[data-theme="dark"]  .input-field select option { color: #F1F5F9; background: #1a2035; }

.input-field input:focus,
.input-field select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.input-field input::placeholder { color: var(--text-tertiary); }
.input-field input:disabled { opacity: .55; cursor: not-allowed; }
.input-hint { margin-top: 5px; font-size: .70rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 5px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #E8790B, #F4A300); color: white;
  border-radius: 10px; font-size: .92rem; font-weight: 700; letter-spacing: .3px;
  transition: all .25s var(--ease); box-shadow: 0 4px 15px rgba(232,121,11,.35);
  margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: var(--font);
}
.btn-primary:hover   { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,121,11,.45); }
.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary.blue { background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: 0 4px 15px rgba(27,77,140,.35); }
.btn-primary.blue:hover { box-shadow: 0 8px 28px rgba(27,77,140,.45); }

.btn-secondary {
  padding: 11px 18px; border-radius: 10px;
  background: var(--surface); border: 1.5px solid var(--border-color);
  color: var(--text-secondary); font-size: .86rem; font-weight: 600;
  transition: all .2s; display: flex; align-items: center; gap: 7px;
  cursor: pointer; font-family: var(--font);
}
.btn-secondary:hover { background: var(--surface-hover); color: var(--text-primary); }

.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .btn-secondary { flex-shrink: 0; }
.btn-row .btn-primary   { flex: 1; }

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading .spinner   { display: inline-block; }
.loading .btn-text  { display: none; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 10px; font-size: .84rem; margin-bottom: 14px; display: none; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.alert.show   { display: flex; align-items: flex-start; gap: 9px; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #FCA5A5; }
.alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #86EFAC; }
.alert-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #93C5FD; }
[data-theme="light"] .alert-error   { color: #B91C1C; }
[data-theme="light"] .alert-success { color: #166534; }
[data-theme="light"] .alert-info    { color: #1E40AF; }

/* ── Info Card (Review step) ────────────────────────────────────────────────── */
.info-card { background: var(--surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 15px 17px; margin-bottom: 14px; }
.info-card-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; flex-wrap: wrap; gap: 4px; }
.info-card-row:last-child { margin-bottom: 0; }
.info-card-label { font-size: .72rem; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.info-card-value { font-size: .87rem; font-weight: 600; color: var(--text-primary); word-break: break-all; }

/* ── Processing Screen ──────────────────────────────────────────────────────── */
.processing-screen { text-align: center; padding: 8px 0; }
.processing-orb {
  width: 70px; height: 70px; margin: 0 auto 22px; border-radius: 50%;
  background: linear-gradient(135deg, #E8790B, #F4A300);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(232,121,11,.4); } 50% { box-shadow: 0 0 0 18px rgba(232,121,11,0); } }
.processing-screen h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 7px; }
.processing-screen p  { font-size: .86rem; color: var(--text-secondary); line-height: 1.6; }
.info-list { list-style: none; margin: 16px 0; }
.info-list li { display: flex; align-items: center; gap: 10px; font-size: .83rem; color: var(--text-secondary); padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.info-list li:last-child { border-bottom: 0; }
.info-list li i { color: var(--secondary); width: 16px; text-align: center; flex-shrink: 0; }

/* ── Questions UI ───────────────────────────────────────────────────────────── */
#questions-wrap { display: none; margin-top: 20px; }
.q-header { margin-bottom: 14px; }
.q-progress-row { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.q-progress-bar  { background: var(--surface); border-radius: 99px; height: 6px; overflow: hidden; }
.q-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-light), var(--secondary)); transition: width .5s ease; }

.q-card {
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: 14px; padding: 20px 18px; margin-bottom: 14px;
}
[data-theme="light"] .q-card { background: rgba(255,255,255,0.9); }

.q-num-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: .63rem; font-weight: 800;
  padding: 3px 10px; border-radius: 99px; margin-bottom: 11px; letter-spacing: .5px;
}
.q-text { font-size: .95rem; font-weight: 600; color: var(--text-primary); line-height: 1.7; margin-bottom: 16px; }

.q-options { display: flex; flex-direction: column; gap: 9px; }
.q-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 11px;
  border: 1.5px solid var(--border-color);
  background: var(--glass-bg); color: var(--text-secondary);
  font-size: .86rem; font-weight: 500; cursor: pointer;
  transition: all .2s; text-align: left; width: 100%;
}
.q-opt:hover { border-color: var(--primary-light); background: rgba(37,99,235,.06); color: var(--text-primary); }
.q-opt.selected { border-color: var(--primary-light); background: rgba(37,99,235,.12); color: var(--primary-light); font-weight: 700; }
[data-theme="light"] .q-opt { background: rgba(255,255,255,0.7); }
[data-theme="light"] .q-opt:hover { background: rgba(37,99,235,.06); }
[data-theme="light"] .q-opt.selected { background: rgba(37,99,235,.10); }

.q-opt-letter {
  min-width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: .70rem; font-weight: 800; color: var(--text-tertiary);
  transition: all .2s; flex-shrink: 0;
}
.q-opt.selected .q-opt-letter { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

.q-textarea {
  width: 100%; padding: 12px 13px;
  border-radius: 11px; border: 1.5px solid var(--border-color);
  background: var(--input-bg); color: var(--input-text);
  font-family: var(--font); font-size: .88rem;
  resize: vertical; outline: none; transition: border .2s, background .3s;
}
.q-textarea:focus { border-color: var(--primary-light); }

.q-nav-row { display: flex; gap: 10px; justify-content: space-between; }
.q-nav-row .btn-primary { flex: 1; margin-top: 0; }

/* ── Report UI ──────────────────────────────────────────────────────────────── */
.report-box { background: var(--surface); border: 1px solid var(--border-color); border-radius: 14px; padding: 18px; margin-top: 14px; }
[data-theme="light"] .report-box { background: rgba(255,255,255,0.8); }

.report-score-row { display: flex; justify-content: center; margin-bottom: 14px; }
.report-score-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 8px 30px rgba(37,99,235,.35);
}
.report-score-circle span { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.report-score-circle small { font-size: .65rem; font-weight: 600; opacity: .8; margin-top: 2px; }

.report-section-title {
  font-size: .80rem; font-weight: 800; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 7px;
}
.report-section-title i { color: var(--primary-light); }
.report-text { font-size: .88rem; color: var(--text-primary); line-height: 1.75; }

.trait-grid { display: flex; flex-direction: column; gap: 10px; }
.trait-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trait-name { font-size: .80rem; font-weight: 600; color: var(--text-primary); min-width: 120px; }
.trait-bar-bg { flex: 1; background: var(--border-color); border-radius: 99px; height: 7px; overflow: hidden; min-width: 60px; }
.trait-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-light), var(--secondary)); transition: width .8s ease; }
.trait-score { font-size: .74rem; font-weight: 700; color: var(--text-secondary); min-width: 36px; text-align: right; }

.career-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.career-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  border-radius: 99px; padding: 6px 13px;
  font-size: .77rem; font-weight: 600; color: #4ade80;
}
[data-theme="light"] .career-chip { color: #15803D; background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); }

/* ── Consent ────────────────────────────────────────────────────────────────── */
.consent-box { background: rgba(37,99,235,.07); border: 1px solid rgba(37,99,235,.2); border-radius: 12px; padding: 13px 15px; margin-bottom: 14px; }
.consent-box p { font-size: .81rem; color: var(--text-secondary); line-height: 1.65; }
.consent-box strong { color: var(--text-primary); }
.checkbox-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--primary-light); cursor: pointer; }
.checkbox-group label { font-size: .81rem; color: var(--text-secondary); cursor: pointer; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
════════════════════════════════════════════════════════════════════════════ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
  .psych-card { padding: 32px 24px; border-radius: 22px; }
  .card-header h1 { font-size: 1.25rem; }
  .q-text { font-size: .92rem; }
  .trait-name { min-width: 100px; font-size: .78rem; }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
  .page-container { padding: 16px 10px 48px; }

  /* Card */
  .psych-card { padding: 22px 16px; border-radius: 18px; max-width: 100%; }

  /* Header */
  .card-header h1 { font-size: 1.15rem; }
  .card-header p  { font-size: .82rem; }
  .card-header-icon { width: 56px; height: 56px; font-size: 1.4rem; }

  /* Navbar */
  .navbar { padding: 10px 14px; }
  .nav-logo-name { font-size: .82rem; }
  .nav-back { padding: 6px 10px; font-size: .75rem; }
  .nav-back span { display: none; } /* hide "Back" text — keep arrow */
  .theme-toggle { width: 34px; height: 34px; }

  /* Steps — hide label text on very small screens */
  .step-label { display: none; }
  .steps { margin-bottom: 16px; }

  /* Form */
  .input-row { grid-template-columns: 1fr; gap: 0; }
  .input-field input,
  .input-field select { font-size: .85rem; padding: 10px 12px 10px 36px; }
  .input-group label { font-size: .72rem; }

  /* Buttons */
  .btn-primary  { font-size: .86rem; padding: 12px; }
  .btn-secondary { font-size: .82rem; padding: 10px 14px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn-secondary { width: 100%; justify-content: center; }

  /* Questions */
  .q-card { padding: 16px 14px; }
  .q-text { font-size: .88rem; margin-bottom: 14px; }
  .q-opt  { font-size: .82rem; padding: 10px 11px; gap: 9px; }
  .q-opt-letter { min-width: 26px; height: 26px; font-size: .67rem; }
  .q-nav-row { gap: 8px; }
  .q-progress-row { font-size: .72rem; }

  /* Report */
  .trait-item  { flex-direction: column; align-items: flex-start; gap: 5px; }
  .trait-name  { min-width: unset; width: 100%; }
  .trait-bar-bg { width: 100%; }
  .report-score-circle { width: 84px; height: 84px; }
  .report-score-circle span { font-size: 1.4rem; }
  .career-chip { font-size: .73rem; padding: 5px 11px; }

  /* Info card */
  .info-card-row { flex-direction: column; align-items: flex-start; }
  .info-card-value { font-size: .84rem; }
}

/* Extra small (≤360px — small Android phones) */
@media (max-width: 360px) {
  .psych-card { padding: 18px 12px; border-radius: 14px; }
  .card-header h1 { font-size: 1.05rem; }
  .btn-primary  { font-size: .82rem; }
  .q-text { font-size: .84rem; }
  .q-opt  { font-size: .79rem; padding: 9px 10px; }
}
