/* ==========================================================================
   TD Driving School — main.css
   ========================================================================== */
:root {
  --accent: #10B981;
  --accent-dark: #059669;
  --ink: #0A0A0A;
  --ink-soft: #4B5563;
  --muted: #6B7280;
  --bg: #FFFFFF;
  --bg-soft: #F7F7F5;
  --line: rgba(10,10,10,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  --font-display: 'Sora', var(--font-sans);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.8rem; margin-bottom: 8px; }
h2 { font-size: 1.3rem; margin-bottom: 16px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.9em; }

main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.brand-mark { color: var(--accent); margin-right: 4px; }
.brand-accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-link { font-size: 0.9rem; color: var(--ink-soft); font-weight: 500; }
.nav-link:hover { color: var(--accent-dark); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.nav-user { font-size: 0.9rem; color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  color: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-danger { color: #dc2626; border-color: rgba(220,38,38,0.25); }
.btn-danger:hover { background: #fef2f2; color: #dc2626; }
.btn-ghost-light { color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* cards */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; }

/* forms */
.form { display: flex; flex-direction: column; gap: 16px; }
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.88rem; font-weight: 500; color: var(--ink-soft);
}
input, select, textarea {
  font-family: inherit; font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
.table tbody tr:last-child td { border-bottom: none; }

/* flashes */
.flashes {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.flash-success { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.flash-error   { border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.06); }

/* pills */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--bg-soft); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pill-success { background: rgba(16,185,129,0.1); color: var(--accent-dark); border-color: rgba(16,185,129,0.3); }
.pill-danger  { background: rgba(220,38,38,0.08); color: #b91c1c; border-color: rgba(220,38,38,0.25); }
.pill-warn    { background: rgba(245,158,11,0.1); color: #b45309; border-color: rgba(245,158,11,0.3); }

/* empty */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }

/* auth */
.auth-wrap { max-width: 440px; margin: 64px auto; padding: 0 24px; }
.auth-wrap .card { padding: 32px; }
.auth-wrap .muted { margin-bottom: 24px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 0.88rem; color: var(--muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* admin shell */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}
.admin-sidebar {
  position: sticky; top: 88px; align-self: start;
  display: flex; flex-direction: column;
}
.admin-sidebar-brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--muted);
  padding: 8px 12px; margin-bottom: 8px;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.1s ease, color 0.1s ease;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-sidebar nav a:hover { background: var(--bg-soft); color: var(--ink); }
.admin-sidebar nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-sidebar nav a.active:hover { background: var(--accent-dark); color: #fff; }
.admin-sidebar-foot { margin-top: 24px; padding: 12px; border-top: 1px solid var(--line); }
.admin-main { min-width: 0; }

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat { padding: 20px 24px; }
.stat-kicker {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; margin-bottom: 4px;
}
.stat-big {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em;
}

/* grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* page head */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.page-head h1 { margin: 0; }

/* search row */
.search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search input { flex: 1; min-width: 220px; }

/* ============================================================
   LANDING
   ============================================================ */
.hero { background: var(--bg); padding: 64px 24px 48px; }
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 16px 0 20px;
}
.hero-title .underline {
  position: relative; display: inline-block; color: var(--accent);
}
.hero-title .underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 10px;
  background: rgba(16,185,129,0.18);
  z-index: -1;
  border-radius: 3px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lede {
  font-size: 1.1rem; color: var(--ink-soft); line-height: 1.6;
  max-width: 520px; margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-trust {
  display: flex; align-items: center; gap: 14px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.stars { color: #f59e0b; letter-spacing: 2px; font-size: 1.05rem; }
.hero-visual { position: relative; border-radius: 20px; overflow: visible; }
.hero-visual img {
  width: 100%; height: 420px; object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(10,10,10,0.12);
}
.hero-card {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 28px rgba(10,10,10,0.12);
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line);
}
.hero-card-1 { bottom: -20px; left: -20px; }
.hero-card-2 { top: 24px; right: -24px; }
.hero-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(16,185,129,0.12); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.hero-card-icon.accent { background: rgba(245,158,11,0.15); color: #b45309; }
.hero-card-title { font-weight: 700; font-size: 0.92rem; }
.hero-card-sub { font-size: 0.78rem; color: var(--muted); }

.stats { background: var(--ink); color: #fff; padding: 40px 24px; }
.stats-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 32px; text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em;
}
.stats .muted { color: rgba(255,255,255,0.6); }

.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-alt {
  background: var(--bg-soft);
  max-width: none;
  padding-left: 24px; padding-right: 24px;
}
.section-alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section-head {
  text-align: center; max-width: 640px; margin: 0 auto 48px;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-top: 12px; line-height: 1.15;
}

.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  font-family: var(--font-display);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; }

.package {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex; flex-direction: column;
  position: relative;
}
.package-featured {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 32px rgba(16,185,129,0.15);
}
.package-badge {
  position: absolute; top: -12px; left: 32px;
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.package-img {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 16px;
}
.package-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; margin-bottom: 8px;
}
.package-price {
  font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 8px;
}
.package-price span { font-size: 1.2rem; vertical-align: super; font-weight: 600; }
.package-features {
  list-style: none;
  margin: 20px 0; padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex: 1;
}
.package-features li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 0.92rem; color: var(--ink-soft);
}
.package-features li::before {
  content: "✓"; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}

.instructor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.instructor img { width: 100%; height: 240px; object-fit: cover; }
.instructor-body { padding: 24px; }
.instructor h3 { font-size: 1.1rem; margin-bottom: 4px; }
.instructor-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.instructor-meta .rating { color: #f59e0b; font-weight: 600; }
.instructor p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; margin-bottom: 12px; }

.review {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.review p { margin: 16px 0 20px; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.6; }

.faq { max-width: 720px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq details[open] { padding-bottom: 24px; }
.faq summary {
  font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1rem;
}
.faq summary::after {
  content: "+"; font-size: 1.3rem; color: var(--muted);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: 12px; color: var(--ink-soft); font-size: 0.94rem; line-height: 1.65; }

.cta-band { background: var(--ink); color: #fff; text-align: center; padding: 80px 24px; }
.cta-band h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.15; margin-bottom: 16px;
}
.cta-band p {
  color: rgba(255,255,255,0.65); max-width: 460px;
  margin: 0 auto 32px; font-size: 1rem;
}
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* footer */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.75);
  padding: 64px 24px 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 2fr; gap: 64px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-tagline { color: rgba(255,255,255,0.5); margin-top: 8px; font-size: 0.9rem; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-cols h4 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.footer-cols a, .footer-cols span {
  display: block; font-size: 0.88rem;
  color: rgba(255,255,255,0.6); margin-bottom: 8px;
}
.footer-cols a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0;
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: rgba(255,255,255,0.4);
}

/* ============================================================
   BOOTSTRAP BANNERS
   ============================================================ */
.bootstrap-banner {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(16,185,129,0.1), rgba(16,185,129,0.04));
  border: 1px solid rgba(16,185,129,0.3);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.bootstrap-banner-soft { background: var(--bg-soft); border-color: var(--line); }

/* ============================================================
   INLINE EDITING
   ============================================================ */
.inline-edit {
  display: inline-block;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 4px;
  cursor: text;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  min-width: 12px;
  min-height: 1em;
}
.inline-edit:hover {
  background: rgba(16,185,129,0.08);
  box-shadow: inset 0 -1px 0 var(--accent);
}
.inline-edit.inline-editing {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  outline: none; cursor: text;
  padding: 2px 8px; margin: -2px -8px;
}
.inline-edit.inline-saved { animation: inlineSaved 0.8s ease; }
.inline-edit.inline-error { animation: inlineError 1.2s ease; }

@keyframes inlineSaved {
  0%   { background: rgba(16,185,129,0); }
  20%  { background: rgba(16,185,129,0.35); }
  100% { background: rgba(16,185,129,0); }
}
@keyframes inlineError {
  0%, 100% { background: rgba(220,38,38,0); }
  50%      { background: rgba(220,38,38,0.25); }
}

.inline-photo {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 8px; overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.inline-photo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10,10,10,0.1);
}
.inline-photo img { width: 100%; height: 100%; object-fit: cover; }
.inline-photo-placeholder { color: var(--muted); font-size: 1.3rem; font-weight: 300; }
.inline-photo.inline-uploading { opacity: 0.6; pointer-events: none; }
.inline-photo.inline-uploading::after {
  content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.6);
}
.inline-photo.inline-uploading::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-photo.inline-saved { box-shadow: 0 0 0 3px rgba(16,185,129,0.4); }
.inline-photo.inline-error { box-shadow: 0 0 0 3px rgba(220,38,38,0.4); }
.inline-photo-tall {
  width: 100%; height: 200px;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { padding: 8px 12px; font-size: 0.9rem; min-width: 160px; }

.tabs { display: flex; gap: 8px; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  flex-direction: row;
}
.tab input { margin: 0; }
.tab:has(input:checked) {
  border-color: var(--accent);
  background: rgba(16,185,129,0.06);
}

.instructor-card { padding: 0; overflow: hidden; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; padding: 20px 16px; gap: 20px; }
  .admin-sidebar { position: static; }
  .admin-sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .admin-sidebar-brand { padding: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-visual img { height: 280px; }
  .hero-card-1 { bottom: -16px; left: 8px; }
  .hero-card-2 { top: 12px; right: 8px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  main { padding: 20px 16px; }
  .nav-inner { padding: 12px 16px; }
  .nav-cta { gap: 6px; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}