/* =====================================================
   main.css — interchangeable theme file
   Swap this file to change the site's visual theme.
   ===================================================== */

/* --- Design tokens (CSS variables) ------------------- */
:root {
  --bg:           #f5e0bb;
  --bg2:          #f5e0bb;
  --bg3:          #efd5a8;
  --text:         #111827;
  --text-dim:     #4b5563;
  --text-faint:   #9ca3af;
  --border:       #e5e7eb;
  --border-soft:  #f3f4f6;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-pill:  999px;

  /* Section accent colours */
  --accent-notes:     #3b82f6;   /* blue */
  --accent-questions: #8b5cf6;   /* violet */
  --accent-topics:    #10b981;   /* emerald */
  --accent-maths:     #f59e0b;   /* amber */
  --accent-default:   #3b82f6;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
  --transition: 180ms ease;
}

/* --- Base -------------------------------------------- */
body {
  background: linear-gradient(135deg, #fdf3e3 0%, #f5e0bb 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
  margin-top: 0;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h3 { font-size: 1.25rem; }

a {
  color: var(--accent-default);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: .75; }

/* --- Navbar ------------------------------------------ */
.navbar {
  background: linear-gradient(135deg, #fdf3e3 0%, #f5e0bb 100%) !important;
  border-bottom: 2px solid #FDC685 !important;
  box-shadow: none !important;
  padding: 0.6rem 0;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--text) !important;
}

.navbar .nav-link {
  color: var(--text-dim) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem !important;
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: var(--bg3);
  color: var(--text) !important;
  opacity: 1;
}


/* --- Cards ------------------------------------------- */
.card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.card-body { padding: 1.25rem; }

/* --- Buttons ----------------------------------------- */
.btn {
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  transition: all var(--transition);
  border: none;
  letter-spacing: 0.01em;
}
.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}

.btn-primary {
  background: #CCA483;
  color: #fff;
}
.btn-primary:hover {
  background: #7E4F3B;
  color: #fff;
  transform: scale(1.02);
}

.btn-secondary {
  background: #CCA483;
  color: #fff;
  border: 1.5px solid #CCA483;
}
.btn-secondary:hover {
  background: #7E4F3B;
  color: #fff;
  border-color: #7E4F3B;
  transform: scale(1.02);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: var(--accent-topics);
  color: #fff;
}
.btn-success:hover { background: #059669; }

.btn-sm {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
}
.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid #CCA483;
  color: #CCA483;
}
.btn-outline-secondary:hover {
  background: #CCA483;
  color: #fff;
  border-color: #CCA483;
}

/* --- Forms ------------------------------------------- */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: #CCA483;
  box-shadow: 0 0 0 3px rgba(204,164,131,.2);
  outline: none;
}
.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

/* --- Tables ------------------------------------------ */
.table {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--shadow-sm);
}
.table thead th {
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg2); }

/* --- Badges / tags ----------------------------------- */
.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-pill);
}

/* Section accent helpers */
.accent-notes     { color: var(--accent-notes); }
.accent-questions { color: var(--accent-questions); }
.accent-topics    { color: var(--accent-topics); }
.accent-maths     { color: var(--accent-maths); }

.tag-notes     { background: #eff6ff; color: var(--accent-notes);     border: 1px solid #bfdbfe; }
.tag-questions { background: #f5f3ff; color: var(--accent-questions); border: 1px solid #ddd6fe; }
.tag-topics    { background: #ecfdf5; color: var(--accent-topics);    border: 1px solid #a7f3d0; }
.tag-maths     { background: #fffbeb; color: var(--accent-maths);     border: 1px solid #fde68a; }

/* --- Page header utility ----------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.page-header h1, .page-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

/* --- Section divider strip --------------------------- */
.section-strip {
  height: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
  background: var(--accent-default);
}
.section-strip.notes     { background: var(--accent-notes); }
.section-strip.questions { background: var(--accent-questions); }
.section-strip.topics    { background: var(--accent-topics); }
.section-strip.maths     { background: var(--accent-maths); }

/* --- Footer ------------------------------------------ */
.footer {
  background: linear-gradient(135deg, #fdf3e3 0%, #f5e0bb 100%);
  border-top: 2px solid #FDC685 !important;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}


/* --- Alerts ------------------------------------------ */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
}

/* --- Homepage ---------------------------------------- */
.home-hero {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
}
.home-brand {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text);
}
.home-beta {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #6c63ff;
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: super;
  line-height: 1.4;
}
.home-tagline {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0.4rem 0 0;
}
.home-printables-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c63ff;
  text-decoration: none;
  border: 1.5px solid rgba(108,99,255,0.35);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  transition: background 0.15s, border-color 0.15s;
}
.home-printables-link:hover {
  background: rgba(108,99,255,0.08);
  border-color: #6c63ff;
  color: #6c63ff;
}

.home-sections {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 900px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.home-panel {
  flex: 1;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-divider {
  width: 1px;
  background: var(--border);
  margin: 1rem 0;
  flex-shrink: 0;
}

.home-panel-icon {
  font-size: 2.25rem;
  line-height: 1;
}
.home-panel-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0;
}
.home-panel-body {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0;
  flex: 1;
}
.home-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-go {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #CCA483;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.btn-go:hover,
.btn-go:active {
  background: #7E4F3B;
  transform: translateX(2px);
  color: #fff;
}

.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #CCA483;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  border: none;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.btn-signin:hover,
.btn-signin:active {
  background: #7E4F3B;
  color: #fff;
  opacity: 1;
}


/* Request access modal */
.request-modal {
  border-radius: 12px;
  border: 1px solid var(--border);
}
.request-modal .modal-header {
  padding: 1.25rem 1.5rem 0.5rem;
}
.request-modal .modal-title {
  font-weight: 700;
  font-size: 1.15rem;
}
.request-modal-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.request-modal .form-label {
  font-weight: 600;
  font-size: 0.875rem;
}
.request-modal .form-control {
  border-radius: 8px;
  font-size: 0.9rem;
}
.request-modal .btn-go {
  display: block;
  text-align: center;
  width: 100%;
  justify-content: center;
}

/* --- Feedback side tab -------------------------------- */
.feedback-tab {
  position: fixed;
  right: -32px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center center;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: right 0.2s ease, background 0.2s ease;
}
.feedback-tab:hover {
  right: -28px;
  background: #5a52d5;
}

/* Feedback modal */
.feedback-modal {
  border-radius: 12px;
  border: 1px solid var(--border);
}
.feedback-modal .modal-header {
  padding: 1.25rem 1.5rem 0.5rem;
}
.feedback-modal .modal-title {
  font-weight: 700;
  font-size: 1.15rem;
}
.feedback-modal-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.feedback-modal .form-label {
  font-weight: 600;
  font-size: 0.875rem;
}
.feedback-modal .form-control,
.feedback-modal .form-select {
  border-radius: 8px;
  font-size: 0.9rem;
}
.btn-feedback-submit {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.btn-feedback-submit:hover {
  background: #5a52d5;
  color: #fff;
}
.btn-feedback-submit:disabled {
  opacity: 0.65;
}

/* Tablet — stack panels, tighten spacing */
@media (max-width: 768px) {
  .home-hero {
    padding: 2rem 1rem 1rem;
  }
  .home-sections {
    flex-direction: column;
    padding: 0 1rem;
    margin: 1.5rem auto 2.5rem;
  }
  .home-divider {
    width: auto;
    height: 2px;
    margin: 0;
  }
  .home-panel {
    padding: 2rem 1.25rem;
  }
  .home-panel-title {
    font-size: 1.35rem;
  }
}

/* Mobile — further reduce */
@media (max-width: 400px) {
  .home-hero {
    padding: 1.5rem 1rem 0.75rem;
  }
  .home-panel {
    padding: 1.5rem 1rem;
  }
  .home-panel-body {
    font-size: 0.9rem;
  }
  .btn-go,
  .btn-signin {
    width: 100%;
    justify-content: center;
  }
  .home-panel-actions {
    flex-direction: column;
  }
}

/* --- Printables selector ----------------------------- */
.printables-container {
  max-width: 860px;
  padding-top: 1.5rem;
}

/* Hub card grid */
.printables-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.printables-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.printables-hub-card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-2px, -2px);
  opacity: 1;
  color: var(--text);
}
.printables-hub-icon { font-size: 2rem; line-height: 1; }
.printables-hub-title { font-size: 1.1rem; font-weight: 700; margin-top: 0.25rem; }
.printables-hub-desc { font-size: 0.875rem; color: var(--text-dim); flex: 1; }
.printables-hub-arrow { font-size: 1.1rem; color: #CCA483; font-weight: 700; margin-top: 0.5rem; }

/* SEO content sections */
.seo-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1.5px solid var(--border);
}
.seo-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.seo-section p, .seo-section li { color: var(--text-dim); line-height: 1.7; }
.seo-steps { display: flex; flex-direction: column; gap: 1rem; }
.seo-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.seo-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  background: #CCA483;
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.9rem;
}
.seo-step strong { display: block; margin-bottom: 0.2rem; color: var(--text); }
.seo-step p { margin: 0; }
.seo-list { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.seo-avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.seo-avail-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.seo-avail-card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.seo-avail-card p { font-size: 0.875rem; margin: 0; }
.seo-faq { display: flex; flex-direction: column; gap: 0.5rem; }
.seo-faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.seo-faq-item summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.seo-faq-item summary::after { content: '+'; color: #CCA483; font-weight: 700; font-size: 1.1rem; }
.seo-faq-item[open] summary::after { content: '−'; }
.seo-faq-item p { margin: 0.6rem 0 0; font-size: 0.9rem; }

.home-seo {
  max-width: 860px;
  padding-bottom: 3rem;
}
.seo-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-default);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.page-subhead {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  margin-bottom: 0;
}
.ws-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.ws-section {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 1.25rem 1.5rem;
}
.ws-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.ws-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}

/* Operation cards */
.ws-op-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.ws-op-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  user-select: none;
}
.ws-op-card input[type="radio"] { display: none; }
.ws-op-card:hover {
  border-color: #CCA483;
  box-shadow: 3px 3px 0 #CCA483;
  transform: translate(-1px, -1px);
}
.ws-op-card.selected {
  border-color: #CCA483;
  box-shadow: 4px 4px 0 #7E4F3B;
  transform: translate(-1px, -1px);
  background: rgba(204,164,131,0.08);
}
.ws-op-icon {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.ws-op-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Grade cards */
.ws-grade-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ws-grade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  user-select: none;
  min-width: 110px;
  flex: 1;
}
.ws-grade-card input[type="radio"] { display: none; }
.ws-grade-card:hover {
  border-color: #CCA483;
  box-shadow: 3px 3px 0 #CCA483;
  transform: translate(-1px, -1px);
}
.ws-grade-card.selected {
  border-color: #CCA483;
  box-shadow: 4px 4px 0 #7E4F3B;
  transform: translate(-1px, -1px);
  background: rgba(204,164,131,0.08);
}
.ws-grade-name {
  font-size: 0.875rem;
  font-weight: 700;
}
.ws-grade-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-height: 1em;
  text-align: center;
}

/* Options */
.ws-options-grid {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.ws-option-group { display: flex; flex-direction: column; gap: 0.5rem; }
.ws-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ws-count-row { display: flex; gap: 0.5rem; }
.ws-count-btn {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  user-select: none;
  background: transparent;
}
.ws-count-btn input[type="radio"] { display: none; }
.ws-count-btn:hover {
  border-color: #CCA483;
  box-shadow: 2px 2px 0 #CCA483;
  transform: translate(-1px, -1px);
}
.ws-count-btn.selected {
  border-color: #CCA483;
  box-shadow: 3px 3px 0 #7E4F3B;
  transform: translate(-1px, -1px);
  background: rgba(204,164,131,0.08);
}
.ws-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dim);
}
.ws-toggle input { display: none; }
.ws-toggle-track {
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}
.ws-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
}
.ws-toggle input:checked ~ .ws-toggle-track { background: #CCA483; }
.ws-toggle input:checked ~ .ws-toggle-track::after { transform: translateX(16px); }

/* Optional fields */
.ws-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ws-input { font-size: 0.9rem; }

/* Submit row */
.ws-submit-row {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.ws-generate-btn { font-size: 1rem; padding: 0.7rem 2rem; background: #0d6efd; border-color: #0d6efd; }
.ws-generate-btn:hover, .ws-generate-btn:active { background: #0b5ed7; border-color: #0a58ca; }
.ws-recaptcha-note {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin: 0;
}
.ws-recaptcha-note a { color: var(--text-faint); }

@media (max-width: 768px) {
  .ws-op-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-grade-grid { gap: 0.4rem; }
  .ws-grade-card { min-width: calc(50% - 0.2rem); flex: unset; }
  .ws-fields-row { grid-template-columns: 1fr; }
  .ws-options-grid { gap: 1.25rem; }
  .ws-section { padding: 1rem; box-shadow: 3px 3px 0 #CCA483; }
  .ws-generate-btn { width: 100%; justify-content: center; }
}

/* --- Practice page responsive ------------------------ */
@media (max-width: 768px) {
  .maths-card {
    flex-direction: column;
    gap: .75rem;
  }
  .maths-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .grade-row {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  }
}

/* --- Test page responsive ---------------------------- */
@media (max-width: 768px) {
  .test-shell {
    margin: 1.5rem auto;
  }
  .test-body {
    padding: 1.25rem;
  }
  .test-finished {
    padding: 2rem 1.25rem;
  }
  .test-actions {
    flex-direction: column;
  }
  .test-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .question-text {
    font-size: 1rem;
  }
  .option-btn {
    padding: .6rem .75rem;
    font-size: .9rem;
  }
}

/* --- Breadcrumb -------------------------------------- */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1.5rem 0 1.25rem;
  font-size: 1rem;
}
.breadcrumb-link {
  color: #CCA483;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb-link:hover {
  color: #7E4F3B;
  opacity: 1;
}
.breadcrumb-sep {
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
}
.breadcrumb-current {
  color: var(--text-dim);
  font-weight: 500;
}

/* --- Test page (/test) ------------------------------- */
.test-shell {
  max-width: 680px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}
.test-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: .75rem;
}
.test-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 .5rem;
  text-align: center;
}
.test-score {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  font-size: 1.1rem;
}
.score-correct { font-weight: 700; color: var(--accent-topics); font-size: 1.4rem; }
.score-sep     { color: var(--text-faint); font-size: 1.2rem; }
.score-total   { font-weight: 600; color: var(--text-dim); font-size: 1.2rem; }
.score-label   { color: var(--text-faint); margin-left: .35rem; font-size: 1rem; }
.test-progress-track {
  height: 5px;
  background: var(--bg3);
  border-radius: var(--radius-pill);
  margin-bottom: 1.75rem;
  overflow: hidden;
}
.test-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-questions);
  border-radius: var(--radius-pill);
  transition: width .4s ease;
}
.test-body {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 2rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.test-body:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
}
.question-meta {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .75rem;
}
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.options-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--accent-questions);
  background: #f5f3ff;
}
.option-btn.selected {
  border-color: var(--accent-questions);
  background: #f5f3ff;
  color: var(--accent-questions);
  font-weight: 600;
}
.option-btn.correct  { border-color: var(--accent-topics); background: #ecfdf5; color: var(--accent-topics); }
.option-btn.incorrect { border-color: #ef4444; background: #fef2f2; color: #ef4444; }
.option-btn:disabled { cursor: default; }
.option-label {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.option-btn.selected  .option-label { background: var(--accent-questions); border-color: var(--accent-questions); color: #fff; }
.option-btn.correct   .option-label { background: var(--accent-topics);    border-color: var(--accent-topics);    color: #fff; }
.option-btn.incorrect .option-label { background: #ef4444; border-color: #ef4444; color: #fff; }
.answer-input {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  border-color: var(--border);
}
.answer-input:focus {
  border-color: #CCA483;
  box-shadow: 0 0 0 3px rgba(204, 164, 131, 0.25);
  outline: none;
}
.feedback-box {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 1.25rem;
}
.feedback-box.correct   { background: #ecfdf5; color: var(--accent-topics); border: 1px solid #a7f3d0; }
.feedback-box.incorrect { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.feedback-icon { font-size: 1.1rem; }
.test-actions { display: flex; gap: .75rem; }
.test-actions .btn,
.test-finished .btn {
  background: #CCA483;
  color: #fff;
  border: none;
}
.test-actions .btn:hover,
.test-actions .btn:active,
.test-finished .btn:hover,
.test-finished .btn:active {
  background: #7E4F3B;
  color: #fff;
}
.test-finished {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 3rem 2rem;
  text-align: center;
}
.finished-icon  { font-size: 3rem; margin-bottom: .75rem; }
.finished-title { font-size: 1.6rem; margin-bottom: .5rem; }
.finished-sub   { color: var(--text-dim); font-size: 1rem; margin-bottom: 1.5rem; }

/* --- Practice page (/practice) ----------------------- */
.maths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
}

.maths-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.maths-card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
}

.maths-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--accent-maths);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.maths-card-body { flex: 1; min-width: 0; }

.maths-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}

.maths-card-desc {
  font-size: .82rem;
  color: var(--text-dim);
  margin: 0 0 .85rem;
}

.grade-label {
  font-size: .78rem;
  color: var(--text-dim);
  margin: 0 0 .4rem;
}

.grade-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: .4rem;
}

.grade-btn {
  background: #CCA483;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: .35rem .7rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
}
.grade-btn:hover,
.grade-btn:active {
  background: #7E4F3B;
  transform: scale(.97);
}

.grade-name {
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.grade-range {
  font-size: .68rem;
  font-weight: 400;
  opacity: .85;
  white-space: nowrap;
}

/* --- English page (/app/english) --------------------- */
.english-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
}
.english-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.english-card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
}
.english-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(204,164,131,.15);
  border: 1px solid #CCA483;
  color: #7E4F3B;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.english-card-body { flex: 1; min-width: 0; }
.english-card-title { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; }
.english-card-desc  { font-size: .82rem; color: var(--text-dim); margin: 0 0 .85rem; }

/* --- Words grid (/app/english/words) ----------------- */
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}
.word-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  color: var(--text);
}
.word-card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
  opacity: 1;
}
.word-card-header {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.word-text    { font-size: 1.05rem; font-weight: 700; }
.word-pos {
  font-size: .72rem;
  color: #7E4F3B;
  background: rgba(204,164,131,.15);
  border: 1px solid #CCA483;
  border-radius: 999px;
  padding: .1rem .45rem;
}
.word-meaning { font-size: .85rem; color: var(--text-dim); line-height: 1.4; }
.word-footer  {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .4rem;
  border-top: 1px solid var(--border);
}
.word-seen { font-size: .72rem; color: var(--text-dim); }
.word-new {
  font-size: .72rem;
  font-weight: 700;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: .1rem .45rem;
}
.word-admin-links { display: flex; gap: .3rem; }
.btn-xs { font-size: .7rem; padding: .15rem .4rem; }

/* --- Word detail card -------------------------------- */
.word-detail-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 1.75rem;
  max-width: 600px;
}
.word-meaning-text { font-size: 1.1rem; line-height: 1.6; margin: .75rem 0 1.25rem; }
.word-grade-label  { font-size: .8rem; color: var(--text-dim); margin: 0; }

/* --- Dashboard cards (student / parent) -------------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.dash-card:hover {
  border-color: #CCA483;
  box-shadow: 6px 6px 0 #7E4F3B;
  transform: translate(-1px, -1px);
}

.dash-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.dash-card-desc {
  font-size: .88rem;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}

.dash-card-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.dash-section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .25rem;
}

/* --- Word of the Day --------------------------------- */
.wotd-card {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #CCA483;
  padding: 1.25rem 1.5rem;
}
.wotd-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #CCA483;
  margin-bottom: .6rem;
}
.wotd-body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.wotd-left {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.wotd-word {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.wotd-pos {
  font-size: .75rem;
  color: #CCA483;
  background: transparent;
  border: 1px solid #CCA483;
  border-radius: 999px;
  padding: .15rem .55rem;
}
.wotd-meaning {
  font-size: .95rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: .25rem 0 0;
}
.wotd-footer {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.wotd-link {
  font-size: .8rem;
  color: #CCA483;
  text-decoration: none;
  font-weight: 600;
}
.wotd-link:hover {
  color: #7E4F3B;
  opacity: 1;
}

/* --- Utility ----------------------------------------- */
.text-muted     { color: var(--text-faint) !important; }
.text-secondary { color: var(--text-dim) !important; }
.bg-light       { background: var(--bg2) !important; }

/* --- Responsive: Tablet / iPad (≤ 1024px) ----------- */
@media (max-width: 1024px) {
  /* Tables scroll horizontally instead of overflowing layout */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  /* Allow td text to wrap again where not action buttons */
  .table tbody td:not(.td-actions) {
    white-space: normal;
  }
}

/* --- Responsive: Tablet portrait / large phone (≤ 768px) */
@media (max-width: 768px) {
  /* Page header wraps — title stays full-width, buttons drop below */
  .page-header {
    flex-wrap: wrap;
  }
  .page-header h1,
  .page-header h2 {
    flex: 1 1 100%;
  }

  /* Card body — tighter padding */
  .card-body {
    padding: 1rem;
  }

  /* Dash/maths/english/word cards — tighter padding */
  .dash-card,
  .maths-card,
  .english-card,
  .word-card,
  .wotd-card {
    padding: 1rem;
  }

  /* Maths card — stack icon above content */
  .maths-card,
  .english-card {
    flex-direction: column;
    gap: .6rem;
  }

  /* Word detail card — full width */
  .word-detail-card {
    max-width: 100%;
  }

  /* Test shell — full width with tighter margin */
  .test-shell {
    margin: 1rem auto;
    padding: 0 .75rem;
  }

  /* Home panels already stacked at 768px */

  /* Container inner padding reduction */
  .container.py-4,
  .container-fluid.py-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Reduce breadcrumb font slightly */
  .breadcrumb-nav {
    font-size: .9rem;
  }
}

/* --- Utility ----------------------------------------- */
.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* Hub navigation link */
.nav-hub-link {
  color: #6b7280 !important;
  font-size: .85rem !important;
}

/* Table action cells — no wrapping */
.td-actions { white-space: nowrap; }

/* Stat cards (student details) */
.stat-num { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: .85rem; color: var(--text-dim); }

/* Score value (color applied dynamically via inline style) */
.score-value { font-weight: 600; }

/* Setup / welcome page */
.setup-container { max-width: 560px; }
.role-icon { font-size: 2rem; }

/* Constrained form select widths */
.form-select-sm-width { max-width: 200px; }
.form-select-med-width { max-width: 280px; }

/* Code/pre preview block */
.code-preview {
  background: var(--bg2);
  padding: .6rem .8rem;
  border-radius: 6px;
  font-size: .75rem;
  color: var(--text-dim);
}

/* Timer bar (take-test page) */
.timer-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.timer-label { font-size: .85rem; color: #6c757d; }
.timer-display {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
}
.timer-track {
  flex: 1;
  background: #e9ecef;
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.timer-progress {
  height: 100%;
  background: #0d6efd;
  transition: width 1s linear;
  width: 100%;
}

/* --- Responsive: Mobile (≤ 480px) ------------------- */
@media (max-width: 480px) {
  /* Page title slightly smaller */
  .page-header h1 { font-size: 1.3rem; }

  /* Stack all button groups in page header */
  .page-header .d-flex {
    flex-wrap: wrap;
    gap: .4rem;
  }

  /* Full-width buttons in form actions */
  .d-flex.gap-2 .btn,
  .d-flex.gap-2 a.btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  /* Cards fill screen edge-to-edge */
  .card {
    border-radius: var(--radius-sm);
  }

  /* Reduce dash-grid/words-grid column min size */
  .dash-grid,
  .words-grid,
  .english-grid,
  .maths-grid {
    grid-template-columns: 1fr;
  }
}
