/* ============================================================
   Social Styles Assessment — styles.css
   ============================================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:        #1a365d;
  --primary-mid:    #2b6cb0;
  --primary-light:  #4299e1;
  --accent:         #e53e3e;
  --bg:             #f7fafc;
  --bg-card:        #ffffff;
  --border:         #e2e8f0;
  --text:           #2d3748;
  --text-muted:     #718096;

  /* Style accent colours */
  --col-an: #4299e1;
  --col-dr: #ed8936;
  --col-ex: #d69e2e;
  --col-am: #48bb78;

  /* Quadrant background tints */
  --q-an: #ebf8ff;
  --q-dr: #fffaf0;
  --q-ex: #fffff0;
  --q-am: #f0fff4;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   Page system
   ============================================================ */
.page {
  display: none;
  min-height: 100vh;
}
.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Shared layout helpers
   ============================================================ */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 36px 0 8px;
}

.section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}

.section p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 10px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  letter-spacing: 0.3px;
  font-family: inherit;
}
.btn-primary:hover {
  background: var(--primary-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-secondary:hover {
  border-color: var(--primary-mid);
  color: var(--primary-mid);
}
.btn-secondary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.btn-secondary:disabled:hover {
  border-color: var(--border);
  color: var(--text-muted);
}

/* ============================================================
   LANDING PAGE  — single column, full page, no scroll
   ============================================================ */

/* Page is a flex column that fills exactly the viewport — only when active */
#landing-page.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Banner — grows to fill spare vertical space ── */
.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white;
  padding: 20px 20px;
  text-align: center;
  flex: 1;                  /* expand to fill whatever space is left */
  min-height: 80px;         /* never collapse smaller than this */
  max-height: 200px;        /* cap the banner height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.landing-hero h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.landing-hero .subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 4px;
}
.landing-hero .subtitle-sub {
  font-size: 0.88rem;
  opacity: 0.7;
}

/* ── Main content column ── */
.landing-content {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 20px 10px;
  gap: 14px;
}

/* Model description — above the start box */
.model-intro {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  flex-shrink: 0;
}

/* Intro line — above the style cards */
.intro-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-shrink: 0;
  margin-bottom: -4px;
}

/* ── Style cards 2×2 grid ── */
.styles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.style-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  border-left: 3px solid;
}
.style-card.an { border-left-color: var(--col-an); }
.style-card.dr { border-left-color: var(--col-dr); }
.style-card.ex { border-left-color: var(--col-ex); }
.style-card.am { border-left-color: var(--col-am); }
.style-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}
.style-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ── Start section ── */
.start-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Name + count side by side */
.start-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* Name field — takes remaining width */
.name-field {
  flex: 1;
  min-width: 0;
}
.name-field label,
.count-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.name-field input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
  outline: none;
}
.name-field input[type="text"]:focus {
  border-color: var(--primary-light);
  background: white;
}
.name-field input[type="text"].error {
  border-color: var(--accent);
  background: #fff5f5;
}
.name-error {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 5px !important;
  margin-bottom: 0 !important;
  display: none;
}
.name-error.show { display: block; }

/* Count area — fixed width, right side */
.count-area {
  flex-shrink: 0;
}
.count-options {
  display: flex;
  gap: 7px;
  margin-bottom: 5px;
}
.count-btn {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
}
.count-btn span {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}
.count-btn:hover {
  border-color: var(--primary-mid);
  color: var(--primary-mid);
  background: var(--bg-card);
}
.count-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.count-btn.selected span { color: rgba(255,255,255,0.8); }
.count-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 !important;
}

/* Let's Start button — full width */
#start-btn {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
}

/* ── Disclaimer pinned at bottom ── */
.landing-disclaimer {
  flex-shrink: 0;
  background: #fffbeb;
  border-top: 1px solid #f6d860;
  padding: 8px 20px;
  font-size: 0.72rem;
  color: #744210;
  text-align: center;
  line-height: 1.4;
}

/* ── Responsive: phones ── */
@media (max-width: 560px) {
  #landing-page   { height: auto; overflow: auto; }
  .landing-content { overflow: visible; }
  .start-row      { flex-direction: column; }
  .styles-grid    { grid-template-columns: 1fr; }
}

/* Remove old two-column helpers that are no longer used */
.landing-body, .landing-left, .landing-right { display: contents; }

/* ============================================================
   QUIZ PAGE
   ============================================================ */
.quiz-header {
  background: var(--primary);
  color: white;
  padding: 14px 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quiz-header-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

.quiz-header .quiz-title {
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.9;
}

.progress-info {
  font-size: 0.8rem;
  opacity: 0.75;
}

.progress-track {
  height: 3px;
  background: rgba(255,255,255,0.2);
}
.progress-bar {
  height: 100%;
  background: var(--primary-light);
  transition: width 0.45s ease;
  min-width: 4px;
}

.quiz-instruction {
  background: #ebf8ff;
  border-bottom: 1px solid #bee3f8;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.83rem;
  color: var(--primary-mid);
  font-style: italic;
}

.quiz-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 20px 110px;
}

/* Question block */
.question-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.question-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
  user-select: none;
}
.option-label:hover {
  border-color: var(--primary-light);
  background: #ebf8ff;
}
.option-label.selected {
  border-color: var(--primary);
  background: #ebf8ff;
}

.option-label input[type="radio"] {
  display: none;
}

.option-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-label.selected .option-dot {
  border-color: var(--primary);
  background: var(--primary);
}
.option-dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.15s;
}
.option-label.selected .option-dot::after {
  opacity: 1;
}

.option-letter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 16px;
  margin-top: 2px;
  line-height: 1.45;
}
.option-label.selected .option-letter {
  color: var(--primary);
}

.option-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}
.option-label.selected .option-text {
  color: var(--primary);
  font-weight: 500;
}

/* Validation */
.validation-msg {
  color: var(--accent);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 4px;
  display: none;
  padding: 8px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #fed7d7;
}
.validation-msg.show {
  display: block;
}

/* Fixed bottom nav */
.quiz-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.quiz-nav-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   RESULTS PAGE
   ============================================================ */
.results-hero {
  padding: 52px 20px 64px;
  text-align: center;
  color: white;
  transition: background 0.3s;
}

.result-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 5px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}

.results-hero h2 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.result-tagline {
  font-size: 1rem;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

@media (max-width: 520px) {
  .results-hero h2 { font-size: 2rem; }
}

/* Results body */
.results-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* Chart card */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  text-align: center;
}
.chart-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

#style-chart {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  display: block;
}

/* Dimension bars */
.dimension-bars {
  margin-top: 24px;
  text-align: left;
}
.dim-row {
  margin-bottom: 14px;
}
.dim-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.dim-labels strong {
  color: var(--text);
}
.dim-track {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.dim-fill-left {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 99px 0 0 99px;
  transition: width 0.8s ease 0.2s;
}
.dim-fill-right {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border-radius: 0 99px 99px 0;
  transition: width 0.8s ease 0.2s;
}
.dim-midpoint {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: white;
  transform: translateX(-50%);
}

/* Score bars */
.score-bars {
  margin-top: 20px;
  text-align: left;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.score-label {
  width: 90px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}
.score-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 0.8s ease 0.3s;
}
.score-pct {
  width: 36px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Description card */
.desc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 20px;
}
.desc-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.desc-card p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.72;
}

/* Traits grid */
.traits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 540px) {
  .traits-grid { grid-template-columns: 1fr; }
}

.trait-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.trait-card h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
}
.trait-card.strengths h4 { color: #276749; }
.trait-card.growth h4    { color: #9c4221; }

.trait-card ul {
  list-style: none;
  padding: 0;
}
.trait-card ul li {
  font-size: 0.875rem;
  color: var(--text);
  padding: 5px 0 5px 18px;
  position: relative;
  line-height: 1.45;
}
.trait-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.trait-card.strengths ul li::before { background: #48bb78; }
.trait-card.growth ul li::before    { background: #fc8181; }

/* What's next */
.next-card {
  background: linear-gradient(135deg, #ebf8ff 0%, #e9d8fd 100%);
  border: 1px solid #bee3f8;
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 28px;
}
.next-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}
.next-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}
.next-card p::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-mid);
  font-weight: 700;
}
.next-card p:last-child { margin-bottom: 0; }

/* Footer */
.results-footer {
  text-align: center;
}
.results-footer .note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.55;
}

/* Server save status indicator */
.save-status {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.save-status.saving {
  background: #ebf8ff;
  color: var(--primary-mid);
  border: 1px solid #bee3f8;
}
.save-status.success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}
.save-status.error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}

/* ============================================================
   Landing page footer
   ============================================================ */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
}
