:root {
  --ink: #1c1b1a;
  --muted: #5f5a57;
  --accent: #c4663b;
  --accent-strong: #a8502b;
  --accent-cool: #2f6f77;
  --card: rgba(255, 251, 247, 0.92);
  --stroke: rgba(28, 27, 26, 0.12);
  --shadow: 0 20px 40px rgba(35, 27, 20, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Sora", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #f5dfcf 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #d8eef0 0%, transparent 40%),
    linear-gradient(180deg, #f9f2e9 0%, #f4ede4 50%, #f7efe6 100%);
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
}

body::before {
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(196, 102, 59, 0.35), transparent 70%);
}

body::after {
  bottom: -140px;
  left: -100px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(47, 111, 119, 0.35), transparent 70%);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px min(6vw, 72px) 0;
}

.brand {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

main {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 28px 0 64px;
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
  animation: fadeUp 0.8s ease forwards;
}

.hero-copy h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 8px 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  color: var(--accent-cool);
  margin: 0 0 8px;
}

.lead {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 16px;
}

.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.mini-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.mini-links a:hover {
  border-bottom-color: var(--accent-cool);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
}

.login-form {
  display: grid;
  gap: 12px;
  margin: 16px 0 8px;
}

.login-form label {
  font-weight: 600;
  font-size: 0.95rem;
}

.login-form input {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(196, 102, 59, 0.25);
  background: var(--accent-strong);
}

.button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.ghost:hover {
  background: rgba(196, 102, 59, 0.1);
  box-shadow: none;
}

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

.muted {
  color: var(--muted);
}

.info-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 48px;
}

.info-grid .card {
  animation: fadeUp 0.8s ease forwards;
}

.info-grid .card:nth-child(2) {
  animation-delay: 0.1s;
}

.info-grid .card:nth-child(3) {
  animation-delay: 0.2s;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.clean-list li {
  padding-left: 18px;
  position: relative;
}

.clean-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--accent-cool);
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  background: rgba(47, 111, 119, 0.15);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.flash:hover {
  opacity: 0.85;
}

.flash.error {
  background: rgba(196, 102, 59, 0.2);
}

.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.65);
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-family: "Fraunces", serif;
  margin: 8px 0 6px;
}

.progress-note {
  margin: 6px 0 0;
  font-weight: 600;
  color: var(--accent-cool);
}

.aidb-link-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(47, 111, 119, 0.12), rgba(196, 102, 59, 0.08));
  border: 1px solid var(--stroke);
  margin-bottom: 28px;
}

.aidb-link-banner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.lesson-list {
  display: grid;
  gap: 18px;
}

.lesson-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
  gap: 18px;
  align-items: start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.lesson-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lesson-title h2 {
  margin: 0;
  font-size: 1.15rem;
}

.lesson-checklist {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--muted);
}

.checklist-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cool);
}

.lesson-number {
  background: var(--accent-cool);
  color: #fff;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
}

.lesson-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.lesson-progress {
  display: grid;
  gap: 10px;
}

.lesson-progress textarea {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: "Space Grotesk", "Sora", sans-serif;
  resize: vertical;
  min-height: 90px;
  background: #fff;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.notes-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cool);
}

.lesson-save {
  display: flex;
  justify-content: flex-end;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-family: "Fraunces", serif;
  margin: 8px 0 6px;
}

.admin-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-header-actions form {
  margin: 0;
}

.admin-grid {
  display: grid;
  gap: 24px;
}

.admin-card {
  display: grid;
  gap: 18px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.admin-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.admin-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.lms-add h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
}

.lms-add-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-field input,
.form-field select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.lms-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.lms-lesson h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
}

.lms-items {
  display: grid;
  gap: 12px;
}

.lms-item {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.lms-edit-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.lms-order {
  font-weight: 600;
  color: var(--accent-cool);
  min-width: 40px;
}

.lms-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.lms-item-actions form {
  margin: 0;
}

.lms-edit-form input,
.lms-edit-form select {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.95rem;
  background: #fff;
}

.lms-edit-form input {
  flex: 1;
  min-width: 200px;
}

.admin-notes h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cool);
}

.admin-checklist-grid {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
}

.admin-checklist-grid table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-checklist-grid th,
.admin-checklist-grid td {
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.admin-checklist-grid th {
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.admin-checklist-grid .lesson-col {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.grid-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  word-break: break-word;
}

.grid-item input {
  margin-top: 2px;
  accent-color: var(--accent-cool);
}

.empty-cell {
  color: var(--muted);
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
}

.note-item p {
  margin: 0;
  white-space: pre-wrap;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.note-title {
  font-weight: 600;
  color: var(--ink);
}

.note-time {
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px dashed var(--accent-cool);
  color: var(--accent-cool);
  font-weight: 600;
}

.credit-card {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.6);
}

.credit-card a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.site-footer {
  padding: 16px 0 32px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 20px 6vw 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .button {
    width: 100%;
  }

  .lesson-links .button {
    width: auto;
  }

  .lesson-row {
    grid-template-columns: 1fr;
  }

  .lesson-save {
    justify-content: flex-start;
  }

  .view-as-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .lms-item {
    align-items: stretch;
  }

  .lms-edit-form {
    width: 100%;
  }

  .lms-item-actions {
    width: 100%;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 27, 26, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 520px;
  width: 100%;
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 48px rgba(35, 27, 20, 0.25);
  animation: slideUp 0.3s ease;
}

.modal-content h2 {
  font-family: "Fraunces", serif;
  margin: 0 0 16px;
  color: var(--ink);
}

.modal-content p {
  margin: 0 0 14px;
  line-height: 1.6;
  color: var(--muted);
}

.modal-content p:last-of-type {
  margin-bottom: 24px;
}

.caret-image {
  display: inline-block;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin: 0 4px;
  border-radius: 50%;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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