/* ═══════════════════════════════════════════
   SST WORKSHEET — STYLES
   Palette: Indigo Ink + Parchment
   Fonts: Cormorant Garamond + Manrope
═══════════════════════════════════════════ */

:root {
  --ink:        #1B0A3C;
  --ink-mid:    #3D1E7C;
  --ink-light:  #7B68EE;
  --ink-pale:   #E8E0F0;
  --parchment:  #F7F4FF;
  --white:      #FFFFFF;
  --gold:       #C9A87C;
  --gold-light: #F2EDE4;
  --text:       #1B0A3C;
  --text-muted: #6B5B8A;
  --border:     #D4C8F0;
  --green:      #1A6B3C;
  --green-bg:   #E8F5EE;
  --green-border:#A8D5B8;
  --red:        #9B1C1C;
  --red-bg:     #FEF2F2;
  --red-border: #FCA5A5;
  --two-mark:   #3D1E7C;
  --three-mark: #B5563E;
  --three-bg:   #FDF0EC;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(27,10,60,0.08);
  --shadow-md:  0 4px 20px rgba(27,10,60,0.12);
  --shadow-lg:  0 8px 40px rgba(27,10,60,0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--parchment);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

/* ── HEADER ── */
.site-header {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-mid) 60%, #5B3A9C 100%);
  color: var(--white);
  padding: 48px 24px 40px;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(123,104,238,0.18); pointer-events: none;
}
.site-header::after {
  content: '';
  position: absolute; bottom: -80px; left: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(201,168,124,0.12); pointer-events: none;
}
.header-inner { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }

.header-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px;
}
.total-badge { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.main-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 700; line-height: 1.1;
  color: var(--white); margin-bottom: 10px;
}
.main-title em { font-style: italic; color: var(--gold); }

.subtitle {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 28px;
}
.header-divider {
  width: 60px; height: 3px;
  background: var(--gold); border-radius: 2px; margin-bottom: 24px;
}
.instructions-bar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: rgba(255,255,255,0.75);
}

/* ── SECTION NAV ── */
.section-nav {
  display: flex; gap: 10px; flex-wrap: wrap;
  max-width: 860px; margin: 28px auto 0; padding: 0 24px;
}
.nav-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--white); border: 2px solid var(--border);
  color: var(--ink); text-decoration: none;
  font-size: 12px; font-weight: 700;
  padding: 10px 18px; border-radius: var(--radius-md);
  transition: all 0.2s; box-shadow: var(--shadow-sm); letter-spacing: 0.02em;
}
.nav-pill span { font-size: 10px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.nav-pill:hover {
  background: var(--ink); border-color: var(--ink); color: var(--white);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.nav-pill:hover span { color: rgba(255,255,255,0.7); }

/* ── MAIN CONTENT ── */
.main-content { max-width: 860px; margin: 0 auto; padding: 32px 24px 60px; }

/* ── WORKSHEET SECTION ── */
.ws-section { margin-bottom: 48px; }

.section-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--border); }
.section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-light); margin-bottom: 6px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.2; margin-bottom: 6px;
}
.section-meta { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.section-meta strong { color: var(--ink); font-weight: 700; }
.section-instruction { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* ── QUESTION CARDS ── */
.questions-list { display: flex; flex-direction: column; gap: 16px; }

.question-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.question-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* correct / wrong card states */
.question-card.correct { border-color: var(--green-border); background: #F6FFF9; }
.question-card.wrong   { border-color: var(--red-border);   background: var(--red-bg); }
.question-card.partial { border-color: #FCD34D;             background: #FFFBEB; }

.q-number {
  grid-column: 1; grid-row: 1 / 4;
  width: 40px; height: 40px;
  background: var(--ink); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  flex-shrink: 0; margin-top: 2px;
}
.question-card.correct .q-number { background: var(--green); }
.question-card.wrong   .q-number { background: var(--red); }
.question-card.partial .q-number { background: #B45309; }

.marks-chip {
  grid-column: 2;
  display: inline-flex; align-items: center;
  background: var(--ink-pale); color: var(--two-mark);
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; width: fit-content; margin-bottom: 8px;
}
.marks-chip.three-mark { background: var(--three-bg); color: var(--three-mark); }
.marks-chip.case-chip  { background: #FFF3E0; color: #B45309; }

.q-body { grid-column: 2; }
.q-text { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.6; margin-bottom: 12px; }

/* ── MCQ OPTIONS ── */
.mcq-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.mcq-option {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text);
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.mcq-option:hover { background: var(--ink-pale); border-color: var(--ink-light); }
.mcq-option input[type="radio"] { accent-color: var(--ink-mid); width: 16px; height: 16px; cursor: pointer; }

.mcq-option.correct-opt { background: var(--green-bg); border-color: var(--green-border); color: var(--green); font-weight: 700; }
.mcq-option.wrong-opt   { background: var(--red-bg);   border-color: var(--red-border);   color: var(--red);   font-weight: 700; }

.opt-label {
  width: 26px; height: 26px;
  background: var(--parchment); border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--ink); flex-shrink: 0;
}

/* ── TEXTAREA ── */
.answer-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--parchment);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
  margin-bottom: 10px;
}
.answer-textarea:focus {
  outline: none;
  border-color: var(--ink-mid);
  box-shadow: 0 0 0 3px rgba(61,30,124,0.1);
  background: var(--white);
}
.answer-textarea:disabled { opacity: 0.7; cursor: not-allowed; }

/* ── FEEDBACK BOX ── */
.feedback-box {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.65;
  transition: all 0.3s ease;
}
.feedback-box.hidden { display: none; }
.feedback-box.correct-fb {
  background: var(--green-bg); border: 1.5px solid var(--green-border); color: var(--green);
}
.feedback-box.wrong-fb {
  background: var(--red-bg); border: 1.5px solid var(--red-border); color: var(--red);
}
.feedback-box.partial-fb {
  background: #FFFBEB; border: 1.5px solid #FCD34D; color: #92400E;
}
.fb-label { font-weight: 800; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.fb-model { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.08); font-style: italic; }
.fb-model-label { font-weight: 700; font-style: normal; }

/* ── MARKS DIVIDER ── */
.marks-divider {
  display: flex; align-items: center; gap: 12px; margin: 8px 0 4px;
}
.marks-divider::before, .marks-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.marks-divider span {
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap; padding: 0 4px;
}

/* ── CASE STUDY ── */
.case-passage {
  background: linear-gradient(135deg, #F0EBF8 0%, #EAE4F5 100%);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--ink-mid);
  border-radius: var(--radius-md);
  padding: 22px 24px; margin-bottom: 24px;
  font-size: 14.5px; line-height: 1.8; color: var(--ink);
}
.passage-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-mid); margin-bottom: 12px;
}
.case-q .q-number { background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 800; }
.case-q.correct .q-number { background: var(--green); color: var(--white); }
.case-q.wrong   .q-number { background: var(--red);   color: var(--white); }

/* ── SUBMIT ZONE ── */
.submit-zone {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 40px 24px; margin: 8px 0 32px;
}
.submit-hint { font-size: 14px; color: var(--text-muted); font-style: italic; }

.submit-btn {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-mid) 100%);
  color: var(--white);
  font-family: 'Manrope', sans-serif;
  font-size: 16px; font-weight: 800;
  padding: 16px 40px; border: none;
  border-radius: 50px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(27,10,60,0.35);
  transition: all 0.25s;
  letter-spacing: 0.02em;
}
.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(27,10,60,0.45);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.submit-icon { font-size: 20px; }

/* ── RESULTS PANEL ── */
.results-panel {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.results-panel.hidden { display: none; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.results-inner { display: flex; flex-direction: column; gap: 28px; }

.results-top {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}

.score-circle {
  width: 110px; height: 110px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-mid) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 6px 24px rgba(27,10,60,0.3);
  transition: background 0.5s;
}
.score-circle.great  { background: linear-gradient(135deg, #1A6B3C, #2D9D5C); }
.score-circle.good   { background: linear-gradient(135deg, #1B5E8A, #2980B9); }
.score-circle.okay   { background: linear-gradient(135deg, #B45309, #D97706); }
.score-circle.low    { background: linear-gradient(135deg, #9B1C1C, #DC2626); }

.score-num  { font-family: 'Cormorant Garamond', serif; font-size: 38px; font-weight: 700; color: var(--white); line-height: 1; }
.score-denom{ font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); }

.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 700; color: var(--ink); margin-bottom: 6px;
}
.results-msg  { font-size: 15px; color: var(--text-muted); margin-bottom: 8px; }
.results-pct  { font-size: 22px; font-weight: 800; color: var(--ink-mid); }

/* Section breakdown */
.section-scores {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
}
.sec-score-card {
  background: var(--parchment);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px; text-align: center;
}
.sec-score-label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.sec-score-val   { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 700; color: var(--ink); }
.sec-score-max   { font-size: 12px; color: var(--text-muted); }

/* Results actions */
.results-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.action-btn {
  padding: 12px 28px; border-radius: 50px; border: 2px solid;
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.02em;
}
.retry-btn  { background: var(--white); border-color: var(--border); color: var(--ink); }
.retry-btn:hover  { background: var(--ink); border-color: var(--ink); color: var(--white); }
.review-btn { background: var(--ink); border-color: var(--ink); color: var(--white); }
.review-btn:hover { background: var(--ink-mid); border-color: var(--ink-mid); }

/* ── MARKS SUMMARY ── */
.marks-summary {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-top: 48px;
  box-shadow: var(--shadow-md);
}
.marks-summary h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 18px;
}
.marks-grid {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.marks-row {
  display: grid; grid-template-columns: 80px 1fr 80px;
  padding: 10px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.marks-row:last-child { border-bottom: none; }
.marks-row:hover:not(.header-row):not(.total-row) { background: var(--parchment); }
.header-row {
  background: var(--ink); color: var(--white);
  font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.total-row { background: var(--ink-pale); font-weight: 800; color: var(--ink); font-size: 15px; }
.marks-row span:last-child { text-align: right; font-weight: 700; }

/* ── FOOTER ── */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,0.5);
  text-align: center; padding: 20px 24px;
  font-size: 12px; letter-spacing: 0.04em;
}

/* ── PRINT ── */
@media print {
  .section-nav, .submit-zone, .results-panel, .marks-summary { display: none !important; }
  .answer-textarea { border: 1px solid #ccc; background: white; }
  .site-header { background: var(--ink) !important; -webkit-print-color-adjust: exact; }
  .question-card { break-inside: avoid; }
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .question-card { grid-template-columns: 36px 1fr; gap: 0 10px; padding: 16px; }
  .q-number { width: 34px; height: 34px; font-size: 10px; }
  .main-title { font-size: 36px; }
  .section-title { font-size: 24px; }
  .marks-row { grid-template-columns: 60px 1fr 60px; font-size: 13px; }
  .results-top { flex-direction: column; align-items: flex-start; }
  .score-circle { width: 90px; height: 90px; }
  .score-num { font-size: 30px; }
}