/* ==========================================================================
   style.css — Advisory Worksheet System
   Design tokens are fixed; only questions.js should change week to week.
   ========================================================================== */

:root {
  --color-black: #000000;
  --color-tan: #86745c;
  --color-light-tan: #c2baab;
  --color-dark-tan: #6a5c48;
  --color-white: #ffffff;
  --color-black-63: rgba(0, 0, 0, 0.63);
  --color-black-80: rgba(0, 0, 0, 0.8);
  --color-black-88: rgba(0, 0, 0, 0.88);
  --color-gold: #b19977;
  --color-accent: #b19977;
  --color-accent-light: #c2baab;

  --bg-page: #f5f2ed;
  --bg-card: var(--color-white);
  --border-soft: #e3ddd2;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 20px 50px -20px rgba(58, 46, 30, 0.35);
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #f8f5f0 0%, var(--bg-page) 100%);
  color: var(--color-black-88);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   Desktop binder-tab navigation
   ========================================================================== */

.binder-nav {
  display: none;
}

@media (min-width: 860px) {
  .binder-nav {
    display: block;
    padding-left: 28px;
  }

  .binder-nav-inner {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .binder-tab {
    position: relative;
    padding: 10px 18px 12px;
    background: var(--color-light-tan);
    color: var(--color-dark-tan);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.02em;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border-soft);
    border-bottom: none;
    cursor: default;
    opacity: 0.65;
    transform: translateY(6px);
    transition: all 0.25s ease;
    white-space: nowrap;
  }

  .binder-tab.is-complete {
    opacity: 0.85;
    background: var(--color-accent-light);
  }

  .binder-tab.is-active {
    background: var(--bg-card);
    color: var(--color-dark-tan);
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 -6px 16px -10px rgba(0,0,0,0.25);
    border-color: var(--border-soft);
    z-index: 2;
  }

  .binder-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--bg-card);
  }
}

/* ==========================================================================
   Mobile progress bar
   ========================================================================== */

.mobile-progress {
  padding: 4px 6px 0;
}

@media (min-width: 860px) {
  .mobile-progress { display: none; }
}

.mobile-progress-track {
  width: 100%;
  height: 8px;
  background: var(--color-light-tan);
  border-radius: 999px;
  overflow: hidden;
}

.mobile-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-tan), var(--color-gold));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.mobile-progress-label {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-black-63);
  font-weight: 600;
}

/* ==========================================================================
   Worksheet card
   ========================================================================== */

.worksheet-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
}

.worksheet-header {
  padding: 34px 40px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbf9f6 0%, var(--bg-card) 100%);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-tan);
}

.lesson-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 26px;
  color: var(--color-black-88);
  line-height: 1.3;
}

.screen-viewport {
  flex: 1;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .worksheet-header { padding: 24px 20px 16px; }
  .lesson-title { font-size: 21px; }
  .screen-viewport { padding: 24px 20px; }
}

/* Screen content elements */

.screen-intro {
  font-size: 14.5px;
  color: var(--color-black-63);
  line-height: 1.6;
  margin: -6px 0 4px;
  padding: 12px 16px;
  background: #faf7f2;
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
}

.question-prompt {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-black-88);
  line-height: 1.45;
  margin: 0;
  white-space: pre-line;
}

.info-body {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--color-black-80);
  white-space: pre-line;
  background: #faf7f2;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

input[type="text"],
textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15.5px;
  color: var(--color-black-88);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: #fffefc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(177, 153, 119, 0.22);
}

textarea { min-height: 110px; line-height: 1.6; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  background: #fffefc;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-black-80);
}

.choice-card:hover { border-color: var(--color-accent-light); }

.choice-card.is-selected {
  border-color: var(--color-tan);
  background: linear-gradient(0deg, rgba(177,153,119,0.10), rgba(177,153,119,0.10));
  color: var(--color-black-88);
}

.choice-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-light-tan);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.18s ease;
}

.choice-card.is-selected .choice-dot { border-color: var(--color-tan); }
.choice-card.is-selected .choice-dot::after {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--color-tan);
}

.scale-group {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.scale-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px 12px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  background: #fffefc;
}

.scale-item:hover { border-color: var(--color-accent-light); }

.scale-item.is-selected {
  border-color: var(--color-tan);
  background: var(--color-tan);
  color: var(--color-white);
}

.scale-number {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  display: block;
}

.scale-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--color-black-63);
  padding: 0 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.multiline-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.multiline-field label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-tan);
}

/* ==========================================================================
   Footer / navigation buttons
   ========================================================================== */

.worksheet-footer {
  display: flex;
  align-items: center;
  padding: 20px 40px 28px;
  border-top: 1px solid var(--border-soft);
  gap: 12px;
}

@media (max-width: 640px) {
  .worksheet-footer { padding: 16px 20px 24px; }
}

.footer-spacer { flex: 1; }

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--color-tan);
  color: var(--color-white);
  box-shadow: 0 10px 24px -12px rgba(106, 92, 72, 0.65);
}

.btn-primary:hover { background: var(--color-dark-tan); }
.btn-primary:disabled {
  background: var(--color-light-tan);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--color-black-63);
  border: 1.5px solid var(--border-soft);
}

.btn-ghost:hover { border-color: var(--color-tan); color: var(--color-dark-tan); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

/* ==========================================================================
   Review screen
   ========================================================================== */

.review-part {
  margin-bottom: 22px;
}

.review-part-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-dark-tan);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.review-item { margin-bottom: 12px; }
.review-q {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-black-63);
  margin-bottom: 3px;
}
.review-a {
  font-size: 14.5px;
  color: var(--color-black-88);
  white-space: pre-line;
  background: #faf7f2;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.review-a.is-empty { color: var(--color-light-tan); font-style: italic; }

.download-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 30px 20px 10px;
}

.download-banner .btn-primary {
  padding: 16px 38px;
  font-size: 16px;
}

.download-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-dark-tan);
  font-size: 24px;
}

.field-hint {
  font-size: 12.5px;
  color: var(--color-black-63);
  margin-top: -8px;
}
