/* LDRC Pre-Work Workbook Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --navy: #1B2F5B;
  --gold: #C8972A;
  --white: #FFFFFF;
  --card-bg: #F8F7F5;
  --text: #2D2D2D;
  --muted: #6B7280;
  --success: #22C55E;
  --border: #E5E7EB;
  --callout-bg: #FDF6E9;
  --focus-ring: #C8972A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6, .nav-link, .btn, label, .progress-label {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--navy);
  color: var(--white);
  padding: 2rem 1.25rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.sidebar-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-participant {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 2rem;
}

.nav-exercises {
  list-style: none;
  padding: 0;
}

.nav-exercises li {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.nav-link.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.nav-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
}

.nav-indicator.partial {
  border-color: var(--gold);
  background: rgba(200,151,42,0.3);
}

.nav-indicator.complete {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
}

.sidebar-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-actions .btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 3rem 2rem;
  max-width: 1000px;
}

.content-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  margin-top: 2.5rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  margin-top: 2rem;
}

.subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.intro-text {
  margin-bottom: 2rem;
  color: var(--text);
}

.intro-text p {
  margin-bottom: 1rem;
}

.section-description {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.strengths-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.75rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--navy);
}

.strengths-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.strengths-list {
  list-style: none;
  padding: 0;
  counter-reset: strength;
}

.strengths-list li {
  counter-increment: strength;
  padding: 0.4rem 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.strengths-list li::before {
  content: counter(strength);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Callout boxes */
.callout {
  background: var(--callout-bg);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.callout strong {
  font-family: 'DM Sans', sans-serif;
  color: var(--navy);
}

.callout p {
  margin-bottom: 0.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Privacy notice */
.privacy-notice {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.privacy-notice strong {
  font-family: 'DM Sans', sans-serif;
  color: var(--navy);
}

/* Consent */
.consent-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.consent-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

/* Form fields */
.field-group {
  margin-bottom: 1.75rem;
}

.field-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: none;
  overflow: hidden;
}

textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 151, 42, 0.15);
}

select {
  appearance: auto;
  cursor: pointer;
}

/* Radio groups */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.95rem;
}

.radio-option:hover {
  border-color: var(--gold);
  background: var(--callout-bg);
}

.radio-option input[type="radio"] {
  accent-color: var(--navy);
  width: 18px;
  height: 18px;
}

.radio-option.selected {
  border-color: var(--navy);
  background: rgba(27, 47, 91, 0.05);
}

/* Rating scale (1-5) */
.rating-scale-group {
  margin-top: 0.25rem;
}

.rating-need-row {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.rating-need-row h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.rating-scale {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 1rem;
}

.rating-btn {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.rating-btn.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Needs reference table */
.needs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.needs-table th {
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
}

.needs-table th:first-child { border-radius: 8px 0 0 0; }
.needs-table th:last-child { border-radius: 0 8px 0 0; }

.needs-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.needs-table tr:nth-child(even) td {
  background: var(--card-bg);
}

.needs-table td:first-child {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: #243d73;
}

.btn-primary:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-secondary:hover {
  background: rgba(27, 47, 91, 0.05);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
}

.btn-gold:hover {
  background: #b8871f;
}

.btn-danger {
  background: #DC2626;
  color: var(--white);
}

.btn-danger:hover {
  background: #B91C1C;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Navigation buttons */
.exercise-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.exercise-nav-right {
  display: flex;
  gap: 0.75rem;
}

/* Save indicator */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-indicator.visible {
  opacity: 1;
}

/* Welcome page */
.welcome-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.welcome-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.25rem;
}

.welcome-body p {
  margin-bottom: 1rem;
}

.instruction-text {
  margin: 1.5rem 0;
}

/* Admin styles */
.admin-topbar {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
}

.admin-topbar h1 {
  color: var(--white);
  font-size: 1.1rem;
  margin: 0;
}

.admin-topbar a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-topbar a:hover { color: var(--white); }

.admin-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.admin-login-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.admin-login-container h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.login-form {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
}

.login-form .field-group {
  margin-bottom: 1.25rem;
}

.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Source Serif 4', Georgia, serif;
}

.login-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 151, 42, 0.15);
}

.login-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.login-error {
  color: #DC2626;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Stats row */
.stats-row {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.stat-card .stat-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Participant grid table */
.participant-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

.participant-grid th {
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--navy);
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.participant-grid td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.participant-grid tr:hover td {
  background: var(--card-bg);
}

.participant-grid a {
  color: var(--navy);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-yes { background: #D1FAE5; color: #065F46; }
.badge-no { background: #FEE2E2; color: #991B1B; }
.badge-pending { background: #FEF3C7; color: #92400E; }

.exercise-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}

.exercise-indicator.empty {
  border: 2px solid var(--border);
  background: var(--white);
}

.exercise-indicator.partial {
  border: 2px solid var(--gold);
  background: rgba(200,151,42,0.2);
}

.exercise-indicator.complete {
  border: 2px solid var(--success);
  background: var(--success);
  color: var(--white);
}

/* Aggregate view */
.aggregate-section {
  margin-bottom: 3rem;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  width: 140px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 28px;
  background: var(--card-bg);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 600;
  min-width: fit-content;
}

.avg-display {
  font-family: 'DM Sans', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
}

.avg-label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    z-index: 1000;
  }

  .sidebar-brand,
  .sidebar-title,
  .sidebar-participant,
  .sidebar-actions {
    display: none;
  }

  .nav-exercises {
    display: flex;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-exercises li {
    margin: 0;
  }

  .nav-link {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    font-size: 0.7rem;
    text-align: center;
  }

  .nav-link .nav-text {
    display: none;
  }

  .nav-link .nav-short {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem 5rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.3rem; }

  .stats-row {
    flex-direction: column;
  }

  .rating-btn {
    width: 42px;
    height: 42px;
  }

  .exercise-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .exercise-nav-right {
    width: 100%;
  }

  .exercise-nav-right .btn {
    flex: 1;
  }

  .welcome-header h1 {
    font-size: 1.75rem;
  }
}

.nav-link .nav-short {
  display: none;
}

/* Completion message */
.completion-message {
  text-align: center;
  padding: 3rem 0;
}

.completion-message h2 {
  margin-top: 0;
  font-size: 1.75rem;
}

.completion-message p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.completion-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Detail view */
.response-block {
  margin-bottom: 1.5rem;
}

.response-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.response-value {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  min-height: 2.5rem;
}

.response-empty {
  color: var(--muted);
  font-style: italic;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--navy);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Public landing page */
.landing-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(27, 47, 91, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(27, 47, 91, 0.05) 1px, transparent 1px),
    #fdfbf7;
  background-size: 42px 42px;
}

.landing-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 4rem 2rem;
}

.landing-hero {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 4rem;
  align-items: center;
}

.landing-kicker {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.landing-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.98;
  max-width: 760px;
  margin-bottom: 1.25rem;
}

.landing-lede {
  max-width: 620px;
  font-size: 1.18rem;
  line-height: 1.65;
  color: #374151;
  margin-bottom: 2rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.landing-note {
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
  font-size: 0.92rem;
}

.landing-preview {
  position: relative;
  min-height: 520px;
}

.landing-preview::before {
  content: '';
  position: absolute;
  inset: 4rem 0 0 3rem;
  background: var(--navy);
  border-radius: 8px;
  transform: rotate(5deg);
  box-shadow: 0 28px 50px rgba(27, 47, 91, 0.22);
}

.preview-sheet {
  position: relative;
  background: var(--white);
  border: 1px solid rgba(27, 47, 91, 0.12);
  border-radius: 8px;
  padding: 2rem;
  min-height: 500px;
  box-shadow: 0 24px 60px rgba(27, 47, 91, 0.18);
}

.preview-rule {
  width: 58px;
  height: 5px;
  background: var(--gold);
  border-radius: 999px;
  margin-bottom: 1.4rem;
}

.preview-heading,
.preview-line,
.preview-prompt,
.preview-writing {
  border-radius: 999px;
  background: #d9dee8;
}

.preview-heading {
  height: 30px;
  width: 78%;
  background: var(--navy);
  margin-bottom: 1.35rem;
}

.preview-line {
  height: 12px;
  width: 64%;
  margin-bottom: 0.6rem;
}

.preview-line.wide {
  width: 92%;
}

.preview-strengths {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 2rem 0;
}

.preview-strengths span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--callout-bg);
  border: 1px solid rgba(200, 151, 42, 0.32);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
}

.preview-prompt {
  height: 16px;
  width: 52%;
  background: var(--gold);
  margin-bottom: 1rem;
}

.preview-writing {
  height: 86px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to bottom,
      #fff 0,
      #fff 28px,
      #e9edf3 29px,
      #e9edf3 30px
    );
  border: 1px solid #e9edf3;
  margin-bottom: 1rem;
}

.preview-writing.short {
  width: 72%;
  height: 58px;
}

@media (max-width: 860px) {
  .landing-shell {
    align-items: flex-start;
    padding: 2.5rem 1.25rem;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .landing-preview {
    min-height: 360px;
  }

  .landing-preview::before {
    inset: 2rem 0 0 1.5rem;
  }

  .preview-sheet {
    min-height: 350px;
    padding: 1.35rem;
  }
}
