/* ============================================
   Tala — Gold Theme: Questionnaire & Results
   ============================================ */

/* ====== WELCOME ====== */
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; width: 100%; max-width: 480px; margin: 0 auto; }
.welcome__back { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-muted); font-family: var(--font); font-size: 13px; cursor: pointer; margin-bottom: 32px; transition: color var(--transition); -webkit-tap-highlight-color: transparent; }
.welcome__back:hover { color: var(--text-secondary); }
.welcome__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.welcome__icon { width: 40px; height: 40px; }
.welcome__brand { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.welcome__title { font-size: clamp(26px, 5vw, 32px); font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 16px; }
.welcome__sub { font-size: 15px; line-height: 1.6; color: var(--text-secondary); max-width: 360px; margin-bottom: 40px; }
.welcome__time { font-size: 13px; color: var(--text-muted); margin-top: 16px; }

/* ====== QUESTIONNAIRE HEADER ====== */
.q-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px 12px; position: sticky; top: 0; z-index: 10; background: linear-gradient(to bottom, var(--bg) 60%, transparent); }
.q-back { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.q-back:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.q-progress { flex: 1; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.q-progress__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); border-radius: 2px; transition: width 0.5s var(--ease); }
.q-counter { font-size: 13px; font-weight: 500; color: var(--text-muted); flex-shrink: 0; min-width: 40px; text-align: right; }

/* ====== QUESTION BODY ====== */
.q-body { flex: 1; display: flex; flex-direction: column; padding: 8px 20px 0; max-width: 520px; margin: 0 auto; width: 100%; }
.q-content { animation: questionIn 0.4s var(--ease) forwards; }
.q-content--exit { animation: questionOut 0.25s var(--ease) forwards; }
@keyframes questionIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes questionOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }
.q-category { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 12px; opacity: 0.85; }
.q-title { font-size: clamp(20px, 4vw, 24px); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 10px; }
.q-text { font-size: 15px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 28px; }

/* ====== OPTIONS ====== */
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: var(--bg-option); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); -webkit-tap-highlight-color: transparent; user-select: none; position: relative; overflow: hidden; }
.q-option::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(245,200,66,0.06), rgba(212,160,23,0.03)); opacity: 0; transition: opacity var(--transition); }
.q-option:hover { border-color: rgba(255,255,255,0.1); background: var(--bg-option-hover); }
.q-option:hover::before { opacity: 1; }
.q-option--selected { border-color: var(--gold) !important; background: var(--bg-option-active) !important; }
.q-option--selected::before { opacity: 1 !important; }
.q-option__indicator { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); flex-shrink: 0; margin-top: 1px; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.q-option--multi .q-option__indicator { border-radius: 6px; }
.q-option--selected .q-option__indicator { border-color: var(--gold); background: var(--gold); }
.q-option--selected .q-option__indicator::after { content: ''; width: 8px; height: 8px; background: #0A0A0A; border-radius: 50%; animation: dotPop 0.2s var(--ease); }
.q-option--multi.q-option--selected .q-option__indicator::after { border-radius: 2px; background: none; border-bottom: 2px solid #0A0A0A; border-right: 2px solid #0A0A0A; transform: rotate(45deg); width: 6px; height: 10px; margin-bottom: 2px; }
@keyframes dotPop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.q-option__text { font-size: 15px; line-height: 1.45; color: var(--text); position: relative; z-index: 1; }
.q-option__label { font-weight: 600; margin-right: 6px; color: var(--gold); }

/* ====== NUMERIC ====== */
.q-numeric { display: flex; flex-direction: column; gap: 16px; }
.q-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.q-preset { padding: 10px 18px; background: var(--bg-option); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-secondary); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--transition); -webkit-tap-highlight-color: transparent; }
.q-preset:hover { border-color: rgba(255,255,255,0.12); color: var(--text); }
.q-preset--selected { border-color: var(--gold); background: var(--bg-option-active); color: var(--gold); }
.q-numeric__input-wrap { display: flex; align-items: center; gap: 4px; padding: 14px 18px; background: var(--bg-option); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color var(--transition); }
.q-numeric__input-wrap:focus-within { border-color: var(--gold); }
.q-numeric__prefix { font-size: 18px; font-weight: 500; color: var(--text-muted); }
.q-numeric__input { flex: 1; background: none; border: none; outline: none; font-family: var(--font); font-size: 22px; font-weight: 600; color: var(--text); width: 100%; }
.q-numeric__input::placeholder { color: var(--text-muted); }

/* ====== STEPPER ====== */
.q-stepper { display: flex; align-items: center; justify-content: center; gap: 32px; padding: 20px 0; }
.q-stepper__btn { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-option); border: 1px solid var(--border); color: var(--text); font-size: 24px; font-weight: 300; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.q-stepper__btn:hover { border-color: var(--gold); background: var(--bg-option-active); }
.q-stepper__btn:active { transform: scale(0.95); }
.q-stepper__value { font-size: 48px; font-weight: 700; min-width: 60px; text-align: center; transition: transform 0.15s var(--ease); }

/* ====== RANKING ====== */
.q-ranking { display: flex; flex-direction: column; gap: 8px; }
.q-rank-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-option); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); user-select: none; -webkit-tap-highlight-color: transparent; }
.q-rank-item__num { width: 28px; height: 28px; border-radius: 50%; background: rgba(245,200,66,0.1); color: var(--gold); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.q-rank-item__text { font-size: 14px; line-height: 1.4; flex: 1; }
.q-rank-item__grip { color: var(--text-muted); flex-shrink: 0; font-size: 16px; }

/* ====== TRANSITION ====== */
.transition { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; max-width: 420px; margin: 0 auto; min-height: calc(100dvh - 60px); animation: questionIn 0.4s var(--ease) forwards; }
.transition__diamond { font-size: 18px; color: var(--gold); margin-bottom: 24px; opacity: 0.5; }
.transition__title { font-size: 22px; font-weight: 600; line-height: 1.35; margin-bottom: 12px; white-space: pre-line; }
.transition__sub { font-size: 15px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 36px; }

/* ====== FOOTER (Q) ====== */
.q-footer { padding: 16px 20px; padding-bottom: max(16px, env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 60%, transparent); max-width: 520px; margin: 0 auto; width: 100%; }

/* ====== MODAL ====== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal__content { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; padding: 28px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); width: 100%; max-width: 480px; animation: slideUp 0.35s var(--ease); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal__title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal__text { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal__input-area { margin-bottom: 20px; }

/* ====== PROCESSING ====== */
.processing { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; width: 100%; min-height: 100dvh; }
.processing__orbs { display: flex; gap: 8px; margin-bottom: 32px; }
.orb { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.orb--1 { animation: orbPulse 1.4s ease-in-out 0s infinite; }
.orb--2 { animation: orbPulse 1.4s ease-in-out 0.15s infinite; }
.orb--3 { animation: orbPulse 1.4s ease-in-out 0.3s infinite; }
.orb--4 { animation: orbPulse 1.4s ease-in-out 0.45s infinite; }
.orb--5 { animation: orbPulse 1.4s ease-in-out 0.6s infinite; }
@keyframes orbPulse { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.5); opacity: 1; } }
.processing__title { font-size: clamp(18px, 3vw, 22px); font-weight: 600; margin-bottom: 8px; }
.processing__sub { font-size: 15px; color: var(--text-secondary); }

/* ====== RESULTS ====== */
.results { padding: 40px 20px; padding-bottom: max(40px, env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; width: 100%; animation: screenIn 0.5s var(--ease) forwards; }
.results__header { text-align: center; margin-bottom: 36px; }
.results__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); display: block; margin-bottom: 8px; }
.results__band { font-size: clamp(26px, 5vw, 32px); font-weight: 700; letter-spacing: -0.02em; }
.results__scores { display: flex; gap: 12px; margin-bottom: 32px; }
.score-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.score-card__ring { position: relative; width: 72px; height: 72px; }
.score-card__ring svg { width: 100%; height: 100%; }
.score-card__val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.score-card__label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: center; }
.results__section-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; }
.results__allocation { margin-bottom: 28px; }
.alloc-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 12px; }
.alloc-bar__seg { transition: width 0.8s var(--ease); }
.alloc-bar__seg--equity { background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.alloc-bar__seg--bond { background: rgba(255,255,255,0.1); }
.alloc-legend { display: flex; gap: 20px; font-size: 13px; color: var(--text-secondary); }
.alloc-legend__item { display: flex; align-items: center; gap: 6px; }
.alloc-legend__item strong { color: var(--text); font-weight: 600; }
.alloc-dot { width: 8px; height: 8px; border-radius: 50%; }
.alloc-dot--equity { background: var(--gold); }
.alloc-dot--bond { background: rgba(255,255,255,0.25); }

/* Flags */
.results__flags { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.flag-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.flag-card--critical { border-color: rgba(255,107,107,0.3); }
.flag-card--caution { border-color: rgba(245,200,66,0.3); }
.flag-card--opportunity { border-color: rgba(76,175,80,0.3); }
.flag-card__icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.flag-card__body { flex: 1; }
.flag-card__title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.flag-card__desc { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }

/* Modules */
.results__modules { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.module-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.12); border-radius: var(--radius-sm); }
.module-card__icon { font-size: 20px; }
.module-card__text { font-size: 14px; font-weight: 500; }

/* Unlock CTA */
.results__unlock { margin-bottom: 20px; }
.results__unlock-card { background: linear-gradient(135deg, rgba(245,200,66,0.06) 0%, rgba(212,160,23,0.03) 100%); border: 1px solid rgba(245,200,66,0.2); border-radius: var(--radius); padding: 28px 24px; text-align: center; }
.results__unlock-icon { font-size: 32px; margin-bottom: 12px; }
.results__unlock-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.results__unlock-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 20px; }
.results__cta { display: flex; flex-direction: column; gap: 10px; }

/* ====== RESPONSIVE — QUESTIONNAIRE ====== */
@media (max-width: 380px) {
  .q-title { font-size: 20px; }
  .results__scores { gap: 8px; }
  .score-card { padding: 14px 6px; }
  .score-card__ring { width: 60px; height: 60px; }
  .score-card__val { font-size: 16px; }
  .results__unlock-card { padding: 20px 16px; }
}
@media (min-width: 768px) {
  .q-body { justify-content: center; padding-top: 0; }
  .q-header { max-width: 520px; margin: 0 auto; width: 100%; }
  #screen-questionnaire.screen--active { flex-direction: column; }
}

/* ====== ACCESSIBILITY ====== */
*:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(245,200,66,0.25); color: var(--text); }
