/* Universal Astronomy for Schools — portal styles.
   Tokens from D:\schools\docs\dashboard-design.md (the website's own system):
   flat, 24px cards, pill buttons, Montserrat headings, Source Sans 3 body. */
:root {
  --navy-900: #0A1633; --navy-800: #13244A; --navy-700: #16325C; --blue-600: #16407A; --blue-500: #2463A8;
  --cyan: #3CC7DB; --teal: #0E6F80;
  --text: #26364D; --muted: #4A5A70; --on-dark: #D6E0EF;
  --page: #F6F6F6; --surface: #FFFFFF; --alt: #F4F7FA; --alt2: #EEF4F8; --cyan-bg: #E3F4F7;
  --rule: #E1E7EF; --field: #D5DDE8;
  --ok: #2F7D4F; --ok-bg: #E3F1E8; --warn: #8A5A00; --warn-bg: #FBF1DC; --need: #A8461A; --need-bg: #FBE9DD;
  --info: #2463A8; --info-bg: #E5EDF8; --off: #4A5A70; --off-bg: #EEF0F3;
  --head: Montserrat, "Segoe UI", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 400 17px/1.55 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal); }
a:hover { color: var(--blue-600); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); color: var(--navy-700); margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; text-transform: uppercase; }
h2 { font-weight: 800; font-size: 20px; text-transform: uppercase; }
h3 { font-weight: 700; font-size: 17px; }
p { margin: 0; }
.eyebrow { font: 700 12px/1.4 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* demo banner + header */
.demo { background: #FBF1DC; color: #6B4600; text-align: center; font-size: 14px; font-weight: 600; padding: 6px 16px; }
.top { background: var(--navy-900); color: var(--on-dark); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; min-height: 72px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font: 800 13px/1.15 var(--head); letter-spacing: .08em; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--on-dark); text-decoration: none; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 15px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(60,199,219,.16); color: var(--cyan); }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 12px; }
.who .n { text-align: right; line-height: 1.2; }
.who .n b { display: block; color: #fff; font-size: 15px; }
.who .n span { font-size: 13px; color: #9FB3D1; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cyan); color: var(--navy-900); display: flex; align-items: center; justify-content: center; font: 800 14px var(--head); }
.linkbtn { background: none; border: 0; color: #9FB3D1; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 4px; }

main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head p { font-size: 18px; color: var(--muted); max-width: 70ch; }
.flash { background: var(--cyan-bg); color: var(--navy-700); border-radius: 16px; padding: 12px 18px; font-weight: 600; }
.error { background: var(--need-bg); color: var(--need); border-radius: 16px; padding: 12px 18px; font-weight: 600; }

.card { background: var(--surface); border-radius: 24px; padding: 28px; }
.card.alt { background: var(--alt); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  padding: 14px 28px; font: 700 15px var(--head); background: var(--cyan); color: var(--navy-900); min-height: 48px; }
.btn:hover { background: #5AD3E4; color: var(--navy-900); }
.btn.sec { background: var(--surface); color: var(--navy-700); border: 1.5px solid #A9B8CC; }
.btn.sec:hover { background: var(--alt); }
.btn.danger { background: var(--surface); color: var(--need); border: 1.5px solid #E7B9A0; }
.btn.sm { padding: 8px 16px; min-height: 38px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 15px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--field); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip.soft.on { background: var(--cyan-bg); border-color: var(--teal); color: var(--teal); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill.run { color: var(--ok); background: var(--ok-bg); } .pill.built { color: var(--info); background: var(--info-bg); }
.pill.plan { color: var(--off); background: var(--off-bg); } .pill.need { color: var(--need); background: var(--need-bg); }
.pill.off { color: var(--off); background: var(--off-bg); } .pill.warn { color: var(--warn); background: var(--warn-bg); } .pill.soon { color: #6A3D9A; background: #EFE7F7; }
.fchip { border-radius: 999px; padding: 2px 9px; font-size: 13px; font-weight: 700; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--navy-700); font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  font: 400 16px var(--body); color: var(--text); border: 1.5px solid var(--field); border-radius: 14px; padding: 12px 14px; background: #fff; min-height: 48px; width: 100%; }
textarea { resize: vertical; }
.help { font-weight: 400; font-size: 14px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font: 700 11px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 2px solid var(--rule); }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.code { font: 800 30px var(--head); letter-spacing: .08em; color: var(--navy-700); }

/* auth pages */
.auth { max-width: 460px; margin: 40px auto; width: 100%; }
.auth .card { display: flex; flex-direction: column; gap: 18px; }

/* telescope cards */
.results-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.result { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.result img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; background: #0A1633; display: block; }
.rig { display: flex; flex-direction: row; align-items: flex-start; gap: 18px; }
.rig-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rig .photo.has-img { border: 0; padding: 0; overflow: hidden; background: #DCE8F3; }
.rig .photo.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; }
.rig .photo { flex: 0 0 140px; height: 200px; text-align: center; padding: 8px; border-radius: 16px; background: var(--alt2); border: 1.5px dashed #A9B8CC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 14px; }
@media (max-width: 480px) { .rig { gap: 14px; } .rig .photo { flex-basis: 96px; height: 136px; } .rig .cap { display: block; font-size: 14px; } .rig .cap svg { vertical-align: -4px; margin-right: 4px; } .rig .cap .fchip { display: inline-block; margin: 2px 2px 2px 0; } }
.cap { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }

/* plan builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps button { display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 7px 16px 7px 7px; font: 700 15px var(--body); border: 1.5px solid var(--field); background: #fff; color: var(--muted); cursor: pointer; }
.steps button .n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 13px var(--head); background: var(--off-bg); }
.steps button.cur { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.steps button.cur .n { background: var(--cyan); color: var(--navy-900); }
.steps button.done { background: var(--cyan-bg); border-color: #BFE6EC; color: var(--teal); }
.steps button.done .n { background: #fff; color: var(--teal); }
.steps button:disabled { cursor: not-allowed; }
.tgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tcard { text-align: left; padding: 0; border-radius: 20px; overflow: hidden; background: #fff; border: 2px solid var(--rule); cursor: pointer; display: flex; flex-direction: column; font: inherit; color: inherit; }
.tcard.on { border-color: var(--teal); }
.tcard[disabled] { opacity: .55; cursor: not-allowed; }
.tcard .b { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.tcard .t { font: 700 15px var(--head); color: var(--navy-700); }
.sky { display: block; width: 100%; height: auto; background: #050C1F; }
.summary { position: sticky; top: 20px; }
.summary dl { margin: 0; }
.summary .r { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: 700; text-align: right; color: var(--navy-700); }
.stepper { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 8px 12px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--field); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; color: var(--navy-700); }
.stepper b { min-width: 28px; text-align: center; font: 700 16px var(--head); font-variant-numeric: tabular-nums; }

/* sessions */
.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { border-radius: 999px; padding: 8px 14px; font: 600 15px var(--body); border: 1.5px solid var(--field); background: #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot:has(input:checked) { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.slot.busy { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

footer { color: var(--muted); font-size: 14px; text-align: center; padding: 24px; }

@media (max-width: 1000px) { .builder { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 560px) { main { padding: 20px 16px 36px; } .card { padding: 20px; } .grid.two { grid-template-columns: 1fr; } .who .n { display: none; } }
