/* Two Minds Tutoring: the one stylesheet for the public site and the tutor and parent areas.
   Direction A, "Ink and highlighter". The class list with examples is in resources/views/CLAUDE.md.
   No build step: edit this file and reload. */
@import url("/css/fonts.css");

:root {
  color-scheme: light;
  --blue: #21409A;        /* buttons, headings, links, the logo */
  --blue-dark: #182F73;   /* hover and pressed */
  --yellow: #FFD23F;      /* the highlighter: one thing per screen */
  --green: #2E9E6A;       /* progress, done, paid */
  --paper: #F7F9FC;       /* page background */
  --white: #FFFFFF;       /* cards and fields */
  --ink: #131C33;         /* text */
  --muted: #556080;       /* secondary text */
  --line: #D8DEEC;        /* borders */
  --tint: #E6ECFA;        /* pale blue fills */
  --red: #B3261E;         /* errors and unpaid, never decoration */
  --red-tint: #FBE9E7;
  --green-tint: #E3F4EC;
  --yellow-tint: #FFF4CC;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Lexend", "Segoe UI", system-ui, sans-serif;
  --radius: 6px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Layout */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 720px; }
.section { padding-block: clamp(40px, 7vw, 80px); }
.section-tight { padding-block: 32px; }
.band { background: var(--white); border-block: 1px solid var(--line); }
.band-blue { background: var(--blue); color: var(--white); }
.band-blue h2, .band-blue h3 { color: var(--white); }
.band-blue a:not(.btn) { color: var(--white); }
[hidden] { display: none !important; } /* so a hidden part stays hidden whatever its class says */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { gap: 8px; }
.stack-lg { gap: 32px; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid > *, .grid-2 > * { min-width: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.measure { max-width: 65ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }

/* The highlighter. Use it on one phrase per screen. */
.mark { background: linear-gradient(transparent 58%, var(--yellow) 58%); padding: 0 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  padding: 12px 18px; border-radius: var(--radius); border: 2px solid var(--blue);
  background: var(--blue); color: var(--white); min-height: 44px;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--tint); color: var(--blue-dark); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #F2C22B; border-color: #F2C22B; color: var(--ink); }
.btn-danger { background: var(--white); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-small { padding: 7px 12px; font-size: 0.85rem; min-height: 36px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo svg { width: 40px; height: 30px; flex: none; }
.logo-words { display: flex; flex-direction: column; line-height: 1; }
.logo-words b { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.logo-words span { font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; margin-top: 4px; color: var(--muted); }
.logo-light { color: var(--white); }
.logo-light .logo-words span { color: var(--tint); }

/* Public header and footer */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--yellow); }
.nav .btn { color: var(--white); padding: 9px 14px; min-height: 40px; }
.nav .btn:hover { color: var(--white); }
.nav-toggle { display: none; background: none; border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font: 600 0.9rem var(--font-body); color: var(--ink); min-height: 44px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-header .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); max-height: calc(100vh - 70px); overflow-y: auto; }
  .site-header .nav.open { display: flex; }
  .site-header .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-header .nav a[aria-current="page"] { box-shadow: none; }
  .site-header .nav .btn { margin-top: 12px; border-bottom: 2px solid var(--blue); }
}
.site-footer { background: var(--ink); color: #C9D1E6; padding-block: 40px 28px; margin-top: auto; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--white); }
.site-footer h4 { color: var(--white); margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid #2B3555; margin-top: 28px; padding-top: 16px; font-size: 0.82rem; }

/* Cards and lists */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; }
.list > li:last-child { border-bottom: 0; }
.list > li > * { min-width: 0; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.note-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.note-card dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.note-card dd { margin: 0 0 6px; }
.note-card dl { margin: 0; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.85rem; color: var(--muted); }

/* Tutor cards on the public Tutors page */
.tutor-card { display: flex; flex-direction: column; gap: 12px; }
.tutor-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--tint); display: flex; align-items: center; justify-content: center; font: 700 1.6rem var(--font-display); color: var(--blue); flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag { font-size: 0.8rem; font-weight: 500; background: var(--tint); color: var(--ink); padding: 3px 10px; border-radius: 99px; }

/* Badges: state, always with a word */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--tint); color: var(--blue-dark); white-space: nowrap; }
.badge-green { background: var(--green-tint); color: #17633F; }
.badge-yellow { background: var(--yellow-tint); color: #6B5200; }
.badge-red { background: var(--red-tint); color: var(--red); }
.badge-grey { background: #ECEEF3; color: var(--muted); }
.stack > .badge, .stack > .btn, .form > .btn { align-self: flex-start; } /* a badge or button in a column keeps its own width */
.stack > .btn-block, .form > .btn-block { align-self: stretch; }

/* Alerts */
.alert { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 12px 16px; background: var(--white); }
.alert-ok { border-left-color: var(--green); background: var(--green-tint); }
.alert-warn { border-left-color: #D9A400; background: var(--yellow-tint); }
.alert-error { border-left-color: var(--red); background: var(--red-tint); }

/* Tables: always inside .table-wrap so a wide one scrolls by itself on a phone */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--paper); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label, fieldset > legend { font-weight: 600; font-size: 0.92rem; padding: 0; }
.field .help { font-size: 0.82rem; color: var(--muted); }
.field .error, .error { font-size: 0.85rem; color: var(--red); font-weight: 500; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid #B9C2D8; border-radius: var(--radius); padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--yellow); outline-offset: 1px; border-color: var(--blue); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1.5px solid #B9C2D8; border-radius: var(--radius); cursor: pointer; font-weight: 600; background: var(--white); }
.scale input { position: absolute; opacity: 0; }
.scale input:checked + label { background: var(--blue); border-color: var(--blue); color: var(--white); }
.scale input:focus-visible + label { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Price table on the public site */
.price-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font: 400 0.85rem var(--font-body); color: var(--muted); }

/* Steps: only for a real sequence */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: var(--ink); font: 700 1.05rem var(--font-display); display: flex; align-items: center; justify-content: center; }

/* FAQ */
details.faq { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
details.faq + details.faq { margin-top: 10px; }
details.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font: 700 1.2rem var(--font-display); color: var(--blue); }
details.faq[open] summary::after { content: "\2212"; }
details.faq > div { padding: 0 18px 16px; }

/* Long documents: policies, agreements, anything written in Markdown */
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 0.9em; }
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.35rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0; }
.prose li + li { margin-top: 0.35em; }
.doc-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-height: 60vh; overflow-y: auto; }

/* The tutor and parent areas */
.portal-header { background: var(--blue); color: var(--white); }
.portal-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.portal-user { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.portal-user .link-btn { color: var(--white); }
.portal-nav { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.portal-nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.portal-nav .wrap::-webkit-scrollbar { display: none; }
.portal-nav a { flex: none; padding: 14px 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.93rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.portal-nav a:hover { color: var(--ink); }
.portal-nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--yellow); }
.portal-nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--yellow); color: var(--ink); font-size: 0.75rem; font-weight: 600; text-align: center; }
.page { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-title { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.page-title h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }

/* Calendar: a week is seven columns on a wide screen and a list of days on a phone */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cal-day.today { border-color: var(--blue); box-shadow: inset 0 3px 0 var(--yellow); }
.cal-day h4 { font-size: 0.8rem; color: var(--muted); }
.cal-item { display: block; background: var(--tint); border-radius: 4px; padding: 6px 8px; font-size: 0.82rem; text-decoration: none; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.cal-item b { display: block; font-variant-numeric: tabular-nums; }
.cal-item.done { background: var(--green-tint); }
.cal-item.off { background: #ECEEF3; color: var(--muted); text-decoration: line-through; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month .cal-day { min-height: 84px; padding: 6px; }
.cal-month .cal-day.out { background: transparent; border-style: dashed; }
.cal-dow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
@media (max-width: 760px) {
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-week .cal-day { min-height: 0; }
  .cal-month .cal-item { font-size: 0; padding: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); display: inline-block; }
  .cal-month .cal-day { min-height: 52px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 3px; }
  .cal-month .cal-day h4 { width: 100%; }
}

/* The card form on an invoice. Stripe draws the fields in its own frame, so they need room. */
[data-card-fields] { min-height: 120px; min-width: 0; }
[data-card-pay] .btn:disabled { opacity: 0.6; cursor: default; }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(560px, 88%); padding: 10px 14px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--tint); border-color: var(--tint); }
.bubble .meta { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .portal-nav a { transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
}
@media print {
  .site-header, .site-footer, .portal-header, .portal-nav, .no-print { display: none !important; }
  body { background: #fff; }
}
