/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4A7BF7;
  --primary-light: #EEF2FF;
  --primary-dark: #3459c2;
  --green: #34C77B;
  --green-light: #E8FAF0;
  --blue-topic: #6BA3F7;
  --gray-100: #F7F8FA;
  --gray-200: #ECEDF0;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 14px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s ease;
  font-family: var(--font);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-300); }
.btn-text { background: none; color: var(--primary); padding: 8px 12px; }
.btn-text:hover { background: var(--primary-light); }
.btn-lg { padding: 14px 36px; font-size: 17px; border-radius: var(--radius); }

/* ===== LOGO ===== */
.logo { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.logo-sm { font-size: 18px; }
.logo-ai { color: var(--primary); }

/* ===== LANDING ===== */
#screen-landing { background: var(--white); }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; max-width: 1100px; margin: 0 auto;
}
.landing-hero {
  text-align: center; padding: 80px 24px 16px;
  max-width: 700px; margin: 0 auto;
}
.landing-hero h1 {
  font-size: 40px; line-height: 1.2; margin-bottom: 32px;
  font-weight: 800; color: var(--gray-900);
}
.hero-sub {
  font-size: 18px; color: var(--gray-500); margin-bottom: 32px;
  line-height: 1.6;
}
.landing-hero .btn { margin-bottom: 16px; }
.hero-proof {
  margin: 0; font-size: 14px; color: var(--gray-400);
}
.journey-map {
  max-width: 480px; margin: 0 auto 32px; padding: 24px;
  background: #f8f9ff; border-radius: 12px;
}
.journey-step { display: flex; gap: 12px; align-items: flex-start; }
.journey-num { font-size: 20px; min-width: 28px; }
.journey-text { font-size: 14px; line-height: 1.5; color: var(--gray-900); }
.journey-arrow { text-align: center; width: 100%; display: block; color: var(--gray-400); font-size: 18px; margin: 8px 0; }
.journey-finish {
  text-align: center; font-size: 14px; font-weight: 600;
  color: var(--primary); margin-top: 16px;
}
.landing-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: 900px; margin: 0 auto; padding: 0 24px 80px;
}
.feature-card {
  text-align: center; padding: 32px 24px;
  background: var(--gray-100); border-radius: var(--radius);
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-500); }

/* ===== ONBOARDING ===== */
.onboarding-container {
  max-width: 640px; margin: 0 auto; padding: 60px 24px;
}
.onboarding-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 40px;
}
.progress-step {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: var(--gray-200); color: var(--gray-400);
}
.progress-step.active { background: var(--primary); color: var(--white); }
.progress-step.done { background: var(--green); color: var(--white); }
.progress-line {
  width: 60px; height: 3px; background: var(--gray-200);
}
.progress-line.filled { background: var(--green); }
.onboarding-container h2 {
  font-size: 28px; margin-bottom: 8px;
}
.onboarding-hint {
  color: var(--gray-500); margin-bottom: 24px; font-size: 15px;
}
.textarea-full {
  width: 100%; padding: 16px; border: 2px solid var(--gray-200);
  border-radius: var(--radius); font-size: 15px;
  font-family: var(--font); resize: vertical;
  transition: border-color .15s; line-height: 1.6;
}
.textarea-full:focus {
  outline: none; border-color: var(--primary);
}
.drop-zone {
  border: 2px dashed transparent;
  border-radius: 8px;
  padding: 8px;
  transition: all 0.2s ease;
}
.drop-zone--active {
  border-color: var(--primary, #4A7BF7);
  background: rgba(74, 123, 247, 0.05);
}
.pdf-upload-area { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pdf-upload-btn { cursor: pointer; }
.pdf-status { font-size: 13px; color: var(--gray-500); }
.pdf-status.success { color: #065F46; }
.pdf-status.error { color: #DC2626; }
.pdf-status.loading { color: var(--primary); }
.onboarding-actions {
  display: flex; justify-content: space-between; margin-top: 20px;
}

/* ===== LOADING ===== */
#screen-loading {
  display: none; /* overridden by .active */
  align-items: center; justify-content: center;
}
#screen-loading.active {
  display: flex;
}
.loading-container { text-align: center; padding: 40px; }
.loading-spinner {
  width: 48px; height: 48px; border: 4px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.loading-messages { color: var(--gray-500); font-size: 15px; }
.loading-messages p { margin: 6px 0; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== APP NAV ===== */
.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.nav-right { display: flex; align-items: center; gap: 12px; }
.experience-topic-badge {
  background: var(--primary-light); color: var(--primary);
  padding: 4px 12px; border-radius: 16px; font-size: 13px; font-weight: 600;
}
.experience-topic-badge:empty { display: none; }

/* ===== DASHBOARD ===== */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
}
.dash-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.dash-card h3 { font-size: 16px; color: var(--gray-500); margin-bottom: 16px; font-weight: 600; }

/* ===== STEPPER (2.5) ===== */
.dash-stepper-wrap { }
.dash-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 16px 0;
}
.stepper-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px;
}
.stepper-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: var(--gray-200); color: var(--gray-400);
  transition: all .3s;
}
.stepper-step.active .stepper-num { background: var(--primary); color: var(--white); }
.stepper-step.done .stepper-num { background: var(--green); color: var(--white); }
.stepper-step.done .stepper-num::after { content: '✓'; }
.stepper-step.done .stepper-num { font-size: 0; } /* hide number, show checkmark */
.stepper-step.done .stepper-num::after { font-size: 14px; }
.stepper-label { font-size: 11px; color: var(--gray-400); text-align: center; white-space: nowrap; }
.stepper-step.active .stepper-label { color: var(--primary); font-weight: 600; }
.stepper-step.done .stepper-label { color: var(--green); }
.stepper-line {
  width: 40px; height: 3px; background: var(--gray-200); margin-bottom: 20px;
}
.stepper-line.filled { background: var(--green); }

/* ===== ATS REPORT (2.1) ===== */
.dash-ats { }
.dash-ats-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.dash-ats-header h3 { margin-bottom: 0; }
.btn-edit-resume {
  background: none; border: none; padding: 4px 0;
  font-size: 12px; color: var(--gray-400); cursor: pointer;
  white-space: nowrap; text-decoration: underline;
}
.btn-edit-resume:hover { color: var(--gray-500); }
.ats-hint { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; margin-top: -8px; line-height: 1.5; }
.ats-bar-wrap {
  width: 100%; height: 16px; background: var(--gray-200); border-radius: 8px;
  overflow: hidden; margin-bottom: 8px;
}
.ats-bar { height: 100%; background: var(--primary); border-radius: 8px; transition: width 1s ease; }
.ats-percent { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.ats-section { margin-bottom: 16px; }
.ats-section h4 { font-size: 14px; margin-bottom: 8px; color: var(--gray-700); }
.ats-item {
  padding: 10px 12px; margin-bottom: 6px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.5;
}
.ats-match { background: var(--green-light); }
.ats-match strong { color: #065F46; display: block; margin-bottom: 2px; }
.ats-evidence { color: var(--gray-500); font-size: 13px; }
.ats-miss { background: #FEF3C7; }
.ats-miss strong { color: #92400E; display: block; margin-bottom: 2px; }
.ats-suggestion { color: #78716C; font-size: 13px; }

/* ===== TOPICS (2.3 — two-level) ===== */
.topics-origin { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; margin-top: -8px; line-height: 1.6; }
.core-topics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.topic-card {
  background: var(--gray-100); border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all .2s; border: 2px solid transparent;
  position: relative;
}
.topic-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.topic-card h4 { font-size: 15px; margin-bottom: 6px; padding-left: 20px; }
.topic-section { margin-top: 8px; }
.topic-section:first-of-type { margin-top: 0; }
.topic-section-label { display: block; font-weight: 600; font-size: 12px; color: var(--gray-700); margin-bottom: 2px; }
.topic-reason { font-size: 12px; color: var(--gray-700); line-height: 1.5; }
.topic-experience { font-size: 12px; color: var(--primary); font-style: italic; }
.topic-status-dot {
  position: absolute; top: 16px; left: 16px;
  width: 10px; height: 10px; border-radius: 50%;
}
.topic-status-dot.gray { background: var(--gray-300); }
.topic-status-dot.blue { background: #93B8F7; }
.topic-status-dot.green { background: var(--green); }
.topic-card.blue { border-left: 3px solid #93B8F7; }
.topic-card.green { border-left: 3px solid var(--green); }
.topics-summary { font-size: 14px; color: var(--gray-500); margin-bottom: 12px; }
.topics-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip {
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.topic-chip.gray { background: var(--gray-200); color: var(--gray-500); }
.topic-chip.blue { background: #DBEAFE; color: #1E40AF; }
.topic-chip.green { background: var(--green-light); color: #065F46; }
.topic-chip { cursor: pointer; }
.topic-chip.gray:hover { background: var(--gray-300); }
.topic-chip.blue:hover { background: #BFDBFE; }
.topic-chip.green:hover { background: #D1FAE5; }
.topics-progress-wrap { margin-bottom: 16px; }
.topics-progress-wrap .topics-summary { margin-bottom: 8px; }
.topics-skip-row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.topics-skip-btn { white-space: nowrap; }
.skip-confirm-inline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray-700); flex-wrap: wrap; justify-content: flex-end; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.topics-legend { display: flex; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-500); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.gray { background: var(--gray-300); }
.legend-dot.blue { background: #93B8F7; }
.legend-dot.green { background: var(--green); }

/* Sessions history */
.session-list { max-height: 200px; overflow-y: auto; }
.session-item {
  padding: 12px 0; border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
}
.session-item:last-child { border-bottom: none; }
.session-item { display: flex; justify-content: space-between; align-items: center; }
.session-item .session-type { font-weight: 600; color: var(--gray-700); }
.session-item .session-date { color: var(--gray-400); font-size: 12px; white-space: nowrap; margin-left: 8px; }
.empty-state { color: var(--gray-400); font-size: 14px; font-style: italic; }

/* CTA card */
.dash-cta {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-light); border: 2px solid var(--primary);
}
.cta-label { font-size: 13px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.dash-cta h3 { color: var(--gray-900); font-size: 20px; margin-bottom: 4px; }
.dash-cta p { color: var(--gray-500); font-size: 14px; }

/* ===== GOAL SELECTION ===== */
.goals-container { max-width: 780px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.goals-container h2 { font-size: 28px; margin-bottom: 8px; }
.goals-subtitle { color: var(--gray-500); margin-bottom: 32px; }
.goals-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.goal-card {
  background: var(--white); border-radius: var(--radius); padding: 28px 20px;
  box-shadow: var(--shadow); cursor: pointer; transition: all .2s;
  border: 2px solid transparent; text-align: center;
}
.goal-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.goal-icon { font-size: 36px; margin-bottom: 12px; }
.goal-card h3 { font-size: 17px; margin-bottom: 8px; }
.goal-card p { font-size: 14px; color: var(--gray-500); line-height: 1.5; }

/* ===== MATCH ANALYSIS ===== */
.match-container { max-width: 700px; margin: 0 auto; padding: 40px 24px; }
.match-container h2 { font-size: 28px; margin-bottom: 24px; text-align: center; }
.match-score-bar {
  width: 100%; height: 24px; background: var(--gray-200); border-radius: 12px;
  overflow: hidden; margin-bottom: 8px;
}
.match-progress { height: 100%; background: var(--primary); border-radius: 12px; transition: width 1s ease; }
.match-percent { text-align: center; font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 28px; }
.match-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.match-col { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.match-col h3 { font-size: 15px; margin-bottom: 12px; }
.match-item { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); }
.match-item:last-child { border-bottom: none; }
.match-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== EXPERIENCE STRUCTURING ===== */
.experience-layout {
  display: grid; grid-template-columns: 1fr 360px;
  max-width: 1100px; margin: 0 auto;
  height: calc(100vh - 61px);
  height: calc(100dvh - 61px);
}
.experience-chat {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--gray-200);
}
.experience-cards {
  padding: 20px; overflow-y: auto; background: var(--white);
}
.experience-cards h3 { font-size: 16px; margin-bottom: 16px; color: var(--gray-500); }

/* Chat shared */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; /* критично для flex-контейнеров */
}
.chat-msg {
  max-width: 80%; padding: 14px 18px; border-radius: 16px;
  font-size: 15px; line-height: 1.6; animation: fadeIn .3s ease;
}
.chat-msg.assistant {
  background: var(--white); border: 1px solid var(--gray-200);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: var(--primary); color: var(--white);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.chat-msg.typing {
  background: var(--white); border: 1px solid var(--gray-200);
  align-self: flex-start; border-bottom-left-radius: 4px;
  color: var(--gray-400);
}
.chat-input-area {
  display: flex; gap: 12px; padding: 16px 20px;
  background: var(--white); border-top: 1px solid var(--gray-200);
}
.chat-input {
  flex: 1; padding: 12px 16px; border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 15px;
  font-family: var(--font); resize: none;
  min-height: 80px; max-height: 200px; overflow-y: auto;
}
.chat-input:focus { outline: none; border-color: var(--primary); }

/* STAR cards */
.star-card {
  background: var(--gray-100); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  border-left: 4px solid var(--primary);
}
.star-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.star-card .star-section { margin-bottom: 8px; font-size: 13px; }
.star-card .star-label {
  font-weight: 700; color: var(--primary); font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
}
.star-card .star-text { color: var(--gray-700); }
.star-card.confirmed { border-left-color: var(--green); }
.star-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.star-card-header h4 { margin-bottom: 0; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--gray-400); padding: 4px 8px; border-radius: 4px; }
.btn-icon:hover { background: var(--gray-200); color: var(--gray-700); }
.star-editable { cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: background .15s; }
.star-editable:hover { background: var(--primary-light); }
.star-edit-hint { font-size: 11px; color: var(--gray-400); margin-top: 8px; font-style: italic; }

/* ===== MOCK INTERVIEW ===== */
.interview-container {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column;
  height: calc(100vh - 61px);
  height: calc(100dvh - 61px);
}
.interview-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.interviewer-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center; font-size: 24px;
}
.interview-header h3 { font-size: 17px; margin-bottom: 2px; }
.interview-subtitle { font-size: 13px; color: var(--gray-400); }
.interview-container .chat-messages { padding: 24px; }
.interview-container .chat-input-area { padding: 16px 24px; }

/* ===== DEBRIEF ===== */
.debrief-container {
  max-width: 700px; margin: 0 auto; padding: 40px 24px;
}
.debrief-container h2 { font-size: 28px; margin-bottom: 28px; }
.debrief-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.debrief-card h3 { font-size: 16px; margin-bottom: 12px; }
.debrief-strengths { border-left: 4px solid var(--green); }
.debrief-strengths h3 { color: #065F46; }
.debrief-improve { border-left: 4px solid var(--blue-topic); }
.debrief-improve h3 { color: #1E40AF; }
.debrief-delta { border-left: 4px solid var(--primary); }
.debrief-next { border-left: 4px solid var(--gray-400); }
.debrief-card p, .debrief-card div { font-size: 15px; line-height: 1.7; color: var(--gray-700); }

/* ===== PROFILE ===== */
.profile-container { max-width: 480px; margin: 0 auto; padding: 40px 24px; }
.profile-card {
  background: var(--white); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.profile-card h2 { font-size: 24px; margin-bottom: 4px; }
.profile-subtitle { color: var(--gray-500); margin-bottom: 24px; font-size: 15px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--gray-700); }
.form-input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 16px; font-family: var(--font);
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.form-check label { display: inline; font-size: 14px; color: var(--gray-500); cursor: pointer; margin-bottom: 0; }
.profile-skip { text-align: center; margin-top: 12px; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.profile-email-display { color: var(--gray-500); font-size: 14px; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 24px; text-align: center;
}
.stat-item {
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 16px 8px;
}
.stat-value { display: block; font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--gray-500); }
.profile-actions { display: flex; gap: 12px; }
.profile-actions .btn { flex: 1; }

/* ===== LANDING FOOTER & DISCLAIMER (5.7) ===== */
.site-footer { display: none; }
.site-footer a { color: var(--gray-400); font-size: 13px; }
.service-disclaimer {
  font-size: 12px; color: var(--gray-400); margin-top: 8px;
  max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.5;
}
.onboarding-disclaimer { font-size: 12px; color: var(--gray-400); margin-top: 12px; line-height: 1.5; }
.onboarding-disclaimer a { color: var(--primary); }

/* ===== PRE-ASSESSMENT (5.1) ===== */
.assessment-container {
  max-width: 560px; margin: 0 auto; padding: 60px 24px;
}
.assessment-container h2 { font-size: 28px; margin-bottom: 8px; }
.assessment-subtitle { color: var(--gray-500); margin-bottom: 32px; font-size: 15px; line-height: 1.6; }
.slider-group {
  background: var(--white); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.slider-label { font-size: 15px; font-weight: 600; color: var(--gray-700); display: block; margin-bottom: 12px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-min, .slider-max { font-size: 12px; color: var(--gray-400); white-space: nowrap; min-width: 60px; }
.slider-max { text-align: right; }
.assessment-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: var(--gray-200); outline: none;
}
.assessment-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  box-shadow: 0 2px 6px rgba(74,123,247,.3);
}
.assessment-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: none;
}
.slider-value {
  font-size: 20px; font-weight: 800; color: var(--primary);
  min-width: 32px; text-align: center;
}
.assessment-note { font-size: 13px; color: var(--gray-400); margin-top: 20px; line-height: 1.5; }
.assessment-actions { text-align: center; margin-top: 24px; }
.assessment-actions .btn-text { display: block; margin: 8px auto 0; }

/* ===== MINDSET CHAT (5.2) ===== */
.mindset-layout {
  display: grid; grid-template-columns: 1fr 320px;
  max-width: 1000px; margin: 0 auto;
  height: calc(100vh - 61px);
  height: calc(100dvh - 61px);
}
.mindset-chat {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--gray-200);
}
.mindset-cards-panel {
  padding: 20px; overflow-y: auto; background: var(--white);
}
.mindset-cards-panel h3 { font-size: 16px; margin-bottom: 16px; color: var(--gray-500); }

.mindset-card {
  background: var(--gray-100); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  border-left: 4px solid var(--primary);
}
.mindset-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); }
.mindset-negative p { color: #DC2626; font-size: 14px; margin: 4px 0 10px; }
.mindset-reframe p { color: #065F46; font-size: 14px; margin: 4px 0 10px; }
.mindset-evidence p { color: var(--gray-700); font-size: 13px; margin: 4px 0 0; }

/* ===== PRE-INTERVIEW SPLASH (5.6) ===== */
.splash-container {
  max-width: 520px; margin: 0 auto; padding: 80px 24px;
  text-align: center;
}
.splash-icon { font-size: 48px; margin-bottom: 16px; }
.splash-container h2 { font-size: 28px; margin-bottom: 8px; }
.splash-subtitle { color: var(--gray-500); font-size: 16px; margin-bottom: 32px; }
.splash-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); text-align: left;
}
.splash-negative { color: #DC2626; font-size: 15px; margin-bottom: 8px; }
.splash-arrow { text-align: center; font-size: 24px; color: var(--gray-400); margin: 4px 0; }
.splash-reframe { color: #065F46; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.splash-evidence { color: var(--gray-500); font-size: 14px; }

/* ===== ANXIETY PROGRESS (5.4) ===== */
.anxiety-bars { display: flex; align-items: flex-end; gap: 12px; height: 120px; padding-top: 8px; }
.anxiety-bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; }
.anxiety-bar-pair { display: flex; gap: 4px; align-items: flex-end; height: 100px; }
.anxiety-bar {
  width: 18px; border-radius: 4px 4px 0 0; min-height: 8px;
  display: flex; align-items: flex-start; justify-content: center;
  transition: height .5s ease;
}
.anxiety-bar.before { background: #FDE68A; }
.anxiety-bar.after { background: #A7F3D0; }
.anxiety-bar.baseline-bar { background: #93B8F7; }
.bar-val { font-size: 10px; font-weight: 700; color: var(--gray-700); margin-top: -16px; }
.anxiety-bar-label { font-size: 11px; color: var(--gray-400); margin-top: 6px; }
.anxiety-legend { display: flex; gap: 16px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--gray-200); flex-wrap: wrap; }

/* Baseline display */
.anxiety-baseline {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 12px; background: var(--gray-100); border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.baseline-label { font-size: 13px; color: var(--gray-500); font-weight: 600; width: 100%; }
.baseline-item { font-size: 13px; color: var(--gray-700); }
.baseline-item strong { color: var(--primary); font-weight: 800; }
.anxiety-summary { font-size: 13px; color: var(--gray-500); margin-top: 12px; line-height: 1.5; }

/* ===== DEBRIEF ANXIETY (5.3) ===== */
.debrief-anxiety { border-left: 4px solid #F59E0B; }
.debrief-anxiety h3 { color: #92400E; }
.anxiety-result { font-size: 14px; line-height: 1.6; padding: 12px; border-radius: var(--radius-sm); }
.anxiety-result.positive { background: var(--green-light); color: #065F46; }
.anxiety-result.neutral { background: #FEF3C7; color: #92400E; }

/* ===== DASHBOARD MINDSET CARDS ===== */
.dash-mindset-item {
  padding: 10px 0; border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
}
.dash-mindset-item:last-child { border-bottom: none; }
.dash-mindset-neg { display: block; color: #DC2626; margin-bottom: 4px; }
.dash-mindset-ref { display: block; color: #065F46; font-weight: 600; }
.mindset-empty-hint { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* ===== TOPIC COMPLETION BANNER (HIGH-2) ===== */
.topic-completion-banner {
  background: linear-gradient(135deg, #ECFDF5, #F0FDF4);
  border: 1.5px solid #34C77B;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin: 16px 0;
  animation: fadeInUp 0.4s ease;
}
.topic-completion-banner .completion-icon { font-size: 32px; margin-bottom: 8px; }
.topic-completion-banner h3 { margin: 0 0 4px; color: #065F46; }
.topic-completion-banner .completion-topic { font-weight: 600; color: var(--gray-700); margin: 0 0 8px; }
.topic-completion-banner .completion-hint { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; }
.completion-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== STAR ONBOARDING MODAL (MEDIUM-6) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: white; border-radius: 16px; padding: 32px 24px;
  max-width: 400px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-box .modal-emoji { font-size: 40px; margin: 0 0 12px; }
.modal-box h3 { margin: 0 0 12px; font-size: 20px; }
.modal-box p { color: var(--gray-500); line-height: 1.7; margin: 0 0 24px; }
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* ===== CONFIDENCE BEFORE/AFTER (MEDIUM-7) ===== */
.confidence-baseline { padding: 8px 0; margin-bottom: 8px; }
.confidence-baseline .conf-label { font-size: 12px; color: var(--gray-500); display: block; margin-bottom: 4px; }
.confidence-baseline .conf-value { font-size: 14px; color: var(--gray-700); }
.confidence-comparison {
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 0; margin-bottom: 12px;
}
.conf-item { text-align: center; }
.conf-label { font-size: 11px; color: var(--gray-400); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.conf-big { font-size: 32px; font-weight: 700; color: var(--gray-700); display: block; line-height: 1; }
.conf-max { font-size: 14px; font-weight: 400; color: var(--gray-400); }
.conf-sublabel { font-size: 11px; color: var(--gray-500); display: block; margin-top: 4px; }
.conf-item.conf-positive .conf-big { color: #059669; }
.conf-arrow { font-size: 24px; color: var(--gray-300); }
.anxiety-summary { font-size: 13px; color: var(--gray-500); margin: 0; padding-top: 8px; border-top: 1px solid var(--gray-200); }
.anxiety-summary.positive { color: #059669; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-content {
  background: var(--white); border-radius: var(--radius);
  max-width: 640px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h2 { font-size: 20px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-body h3 { font-size: 16px; margin: 20px 0 8px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p, .modal-body li { font-size: 14px; line-height: 1.7; color: var(--gray-700); }
.modal-body ul { margin-left: 20px; }
.privacy-date { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); text-align: right; }

/* Mobile cards toggle — hidden on desktop */
.mobile-cards-toggle { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Landing */
  .landing-hero { padding: 40px 16px 16px; }
  .landing-hero h1 { font-size: 26px; }
  .hero-sub { font-size: 16px; }
  .landing-nav { padding: 16px 20px; }
  .landing-features { grid-template-columns: 1fr; gap: 12px; padding: 0 16px 40px; }
  .journey-map { padding: 16px; font-size: 13px; }

  /* Onboarding */
  .onboarding-container { padding: 32px 16px; }
  .onboarding-container h2 { font-size: 22px; }
  .textarea-full { font-size: 16px; /* prevents iOS zoom on focus */ }

  /* Dashboard */
  .dashboard { padding: 16px; gap: 12px; }
  .dash-card { padding: 20px; }
  .dash-cta { flex-direction: column; gap: 16px; text-align: center; }
  .app-nav { padding: 12px 16px; }
  .core-topics-grid { grid-template-columns: 1fr; }
  .stepper-step { min-width: 55px; }
  .stepper-label { font-size: 10px; }
  .stepper-line { width: 24px; }

  /* Experience structuring */
  .experience-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 53px);
    height: calc(100dvh - 53px);
  }
  .experience-cards {
    display: none;
    position: fixed; top: 53px; left: 0; right: 0; bottom: 0;
    z-index: 100; overflow-y: auto;
  }
  .experience-cards.mobile-visible { display: block; }
  .mobile-cards-toggle {
    display: block;
    width: 100%; border-radius: 0;
    padding: 12px; font-size: 14px;
    border-top: 1px solid var(--gray-200);
  }

  /* Chat */
  .chat-messages { padding: 12px; }
  .chat-msg { max-width: 90%; padding: 12px 14px; font-size: 15px; }
  .chat-input-area { padding: 10px 12px; gap: 8px; }
  .chat-input { font-size: 16px; padding: 10px 12px; min-height: 60px; /* 16px prevents iOS zoom */ }

  /* Interview */
  .interview-container { height: calc(100vh - 53px); height: calc(100dvh - 53px); }
  .interview-header { padding: 12px 16px; gap: 12px; }
  .interview-container .chat-messages { padding: 12px 16px; }
  .interview-container .chat-input-area { padding: 10px 16px; }

  /* Debrief */
  .debrief-container { padding: 24px 16px; }
  .debrief-container h2 { font-size: 22px; }
  .debrief-card { padding: 18px; }

  /* Goals */
  .goals-container { padding: 24px 16px; }
  .goals-grid { grid-template-columns: 1fr; }
  .goals-container h2 { font-size: 22px; }

  /* Match */
  .match-container { padding: 24px 16px; }
  .match-columns { grid-template-columns: 1fr; }
  .match-actions { flex-direction: column; }

  /* Profile */
  .profile-container { padding: 24px 16px; }
  .profile-card { padding: 24px; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .profile-actions { flex-direction: column; }

  /* Legend */
  .topics-legend { flex-wrap: wrap; gap: 10px; }

  /* STAR stage skip / progress */
  .topics-skip-row { justify-content: center; }
  .topics-skip-btn { width: 100%; text-align: center; }
  .skip-confirm-inline { width: 100%; justify-content: center; text-align: center; }
  .skip-confirm-inline .btn { width: 100%; }

  /* Pre-assessment */
  .assessment-container { padding: 32px 16px; }
  .assessment-container h2 { font-size: 22px; }
  .slider-group { padding: 16px; }
  .slider-min, .slider-max { font-size: 11px; min-width: 50px; }

  /* Mindset chat */
  .mindset-layout { grid-template-columns: 1fr; }
  .mindset-cards-panel { display: none; }

  /* Splash */
  .splash-container { padding: 40px 16px; }
  .splash-container h2 { font-size: 22px; }

  /* Anxiety bars */
  .anxiety-bars { gap: 8px; }
  .anxiety-bar { width: 14px; }

  /* Buttons — bigger tap targets on mobile */
  .btn { padding: 12px 24px; min-height: 44px; }
  .btn-lg { padding: 14px 28px; }
}

/* ===== EXTRA SMALL SCREENS (iPhone SE, < 380px) ===== */
@media (max-width: 380px) {
  /* Profile stats: 1 column to prevent cramped numbers */
  .profile-stats { grid-template-columns: 1fr; gap: 8px; }

  /* Slider: hide fixed-width labels to free space */
  .slider-min, .slider-max { font-size: 10px; min-width: 36px; }

  /* Stepper: tighter */
  .stepper-step { min-width: 44px; }
  .stepper-label { font-size: 9px; }

  /* Onboarding textarea */
  .onboarding-textarea { font-size: 14px; }

  /* Nav */
  .nav-brand { font-size: 15px; }

  /* Dashboard topics grid */
  .topics-grid { grid-template-columns: 1fr; }
}

/* ===== PRIVACY HINT ===== */
.privacy-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
  margin-bottom: 0;
  text-align: left;
}
#pdf-quality-warning {
  margin: 6px 0 0 0;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== ANONYMIZE MODAL ===== */
.anon-modal-box {
  max-width: 520px;
  text-align: left;
  padding: 28px 24px;
}
.anon-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 16px;
}
.anon-found {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.anon-item {
  font-size: 13px;
  color: #15803D;
  padding: 2px 0;
}
.anon-clean-msg {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0 0 16px;
}
.anon-edit-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 6px;
}
.anon-textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-700);
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 16px;
}
.anon-modal-actions {
  display: flex;
  gap: 12px;
}
.anon-confirm-btn {
  flex: 1;
}
.anon-back-btn {
  flex: 1;
}

@media (max-width: 768px) {
  .anon-modal-box { padding: 20px 16px; }
  .anon-textarea { min-height: 120px; font-size: 14px; }
  .anon-modal-actions { flex-direction: column; }
}

/* ===== FEEDBACK MODAL ===== */
.feedback-modal-box {
  max-width: 420px;
  width: 100%;
  text-align: left;
  padding: 28px 24px;
  position: relative;
}
.feedback-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}
.feedback-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 4px;
}
.feedback-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 20px;
}
.feedback-field { margin-bottom: 18px; }
.feedback-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.feedback-stars {
  display: flex;
  gap: 6px;
  font-size: 28px;
  line-height: 1;
}
.feedback-stars.error {
  border: 1px solid #e53e3e;
  border-radius: 4px;
  padding: 4px;
  width: fit-content;
}
.feedback-stars-error {
  font-size: 12px;
  color: #e53e3e;
  margin-top: 4px;
}
.feedback-star {
  color: var(--gray-300);
  cursor: pointer;
  transition: color .15s;
}
.feedback-star.active { color: #FFC107; }
.feedback-textarea {
  width: 100%;
  min-height: 70px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  resize: vertical;
}
.feedback-textarea:focus { outline: none; border-color: var(--primary); }
.feedback-charcount {
  text-align: right;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}
.feedback-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
}
.feedback-input:focus { outline: none; border-color: var(--primary); }
.feedback-submit-btn { width: 100%; margin-top: 4px; }
.feedback-skip-btn { display: block; width: 100%; text-align: center; margin-top: 8px; }

/* ===== TOAST ===== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}
.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .feedback-modal-box { width: calc(100% - 32px); max-width: none; }
  .feedback-textarea { min-height: 80px; }
}
