/* NAGTA design system. Tokens from brand/BRAND.md; behavior rules from docs/design-philosophy.md.
   One stylesheet serves the static pages and the Worker-rendered pages so both look identical. */

@font-face {
  font-family: "Jost";
  src: url("/fonts/nagta-jost-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #232949;
  --tint: #E9EBF2;
  --white: #FFFFFF;
  --accent: #2E7D7B;
  --accent-dark: #236362;
  --text-grey: #3F4560;
  --line-grey: #B8BDD0;
  --error: #B3261E;
  --page-max: 1600px;
  --wide-max: 1600px;
  --font: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 27px;
  color: var(--navy);
  background: var(--white);
}

h1, h2, h3, h4 { font-weight: 700; margin: 0; letter-spacing: 0; }
h1 { font-size: 40px; line-height: 44px; }
h2 { font-size: 30px; line-height: 36px; }
h3 { font-size: 22px; line-height: 28px; }
p { margin: 0 0 18px; max-width: 68ch; }
ul, ol { margin: 0 0 18px; padding-left: 22px; max-width: 68ch; }
li { margin-bottom: 8px; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: var(--wide-max); margin: 0 auto; padding: 0 24px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--line-grey); background: var(--white); }
.site-header .wrap-wide {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 20px; padding-bottom: 20px;
}
.site-header img.wordmark { width: 360px; max-width: 60vw; height: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { font-weight: 600; font-size: 15px; text-decoration: none; color: var(--navy); }
.site-nav a:hover { color: var(--accent-dark); text-decoration: underline; }
.site-nav a.btn-primary, .site-nav a.btn-primary:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-tertiary, button.btn-primary, button.btn-secondary {
  font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 20px;
  padding: 10px 20px; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #1b2039; color: #fff; }
.btn-secondary { background: var(--accent); color: #fff; }
.btn-secondary:hover { background: var(--accent-dark); color: #fff; }
.btn-tertiary {
  background: none; color: var(--accent); padding: 6px 0;
  text-decoration: underline; text-underline-offset: 3px; border: 0;
}
.btn-small { font-size: 13px; padding: 6px 12px; }
.btn-primary[disabled], .btn-secondary[disabled] { opacity: .55; cursor: default; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0 0; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: nagta-spin .7s linear infinite;
}
.btn-tertiary .spinner, .btn-outline .spinner { border-color: rgba(46,125,123,.35); border-top-color: var(--accent); }
@keyframes nagta-spin { to { transform: rotate(360deg); } }

/* Sections */
main { display: block; }
.section { padding: 56px 0; }
.section-tint { background: var(--tint); }
.section + .section:not(.section-tint) { border-top: 1px solid var(--line-grey); }
.eyebrow {
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent); margin: 0 0 10px;
}
.rule { width: 64px; height: 3px; background: var(--accent); margin: 14px 0 22px; border: 0; }
.lead { font-size: 20px; line-height: 31px; }
.hero { padding: 60px 0 46px; }
.hero h1 { max-width: 20ch; }
.muted { color: var(--text-grey); }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
table.data { border-collapse: collapse; width: fit-content; max-width: 100%; font-size: 15px; }
table.data th, table.data td {
  border: 1px solid var(--line-grey); padding: 9px 12px; text-align: left; vertical-align: top;
}
table.data thead th { background: var(--tint); font-weight: 700; }
table.data tbody tr:nth-child(even) { background: #FAFBFD; }

/* Forms */
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.help { display: block; font-weight: 400; font-size: 14px; line-height: 21px; color: var(--text-grey); margin: 4px 0 0; max-width: 68ch; }
.field { margin: 0 0 22px; max-width: 620px; }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=search],
input[type=number], input[type=date], select, textarea {
  font-family: var(--font); font-size: 17px; line-height: 24px; color: var(--navy);
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-grey);
  border-radius: 3px; background: #fff;
}
input:focus, select:focus, textarea:focus { background: var(--tint); }
input.invalid, select.invalid, textarea.invalid, .invalid > .combo-field { border-color: var(--error); border-width: 2px; }
.field-note { font-size: 14px; line-height: 21px; color: var(--text-grey); margin-top: 6px; }
.field-note.warn { color: var(--error); }
fieldset { border: 0; margin: 0 0 22px; padding: 0; }
legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.checkline { display: flex; gap: 10px; align-items: flex-start; max-width: 68ch; }
.checkline input[type=checkbox] { width: 20px; height: 20px; margin: 3px 0 0; flex: 0 0 auto; }
.checkline label { font-weight: 400; font-size: 16px; line-height: 25px; margin: 0; }

/* Password eye (no password field exists today; the rule is wired anyway) */
.pwwrap { position: relative; }
.pwwrap input { padding-right: 44px; }
.pweye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: 6px; line-height: 0; color: var(--text-grey);
}

/* Tile picker (large rectangular tiles, never small pills) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin: 0 0 24px; }
.tile {
  display: block; width: 100%; text-align: left; font-family: var(--font);
  background: #fff; border: 2px solid var(--line-grey); border-radius: 3px;
  padding: 20px 22px; cursor: pointer; color: var(--navy);
}
.tile:hover { border-color: var(--accent); background: var(--tint); }
.tile[aria-pressed=true], .tile.selected { border-color: var(--accent); background: var(--tint); }
.tile .tile-name { font-weight: 700; font-size: 21px; line-height: 27px; display: block; }
.tile .tile-help { font-weight: 400; font-size: 14px; line-height: 21px; color: var(--text-grey); display: block; margin-top: 8px; }

/* Radio cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card-choice {
  border: 2px solid var(--line-grey); border-radius: 3px; padding: 16px 18px; cursor: pointer; background: #fff;
}
.card-choice:hover { border-color: var(--accent); }
.card-choice.selected { border-color: var(--accent); background: var(--tint); }
.card-choice .price { font-weight: 700; font-size: 24px; line-height: 30px; display: block; }
.card-choice .desc { font-size: 15px; line-height: 22px; color: var(--text-grey); display: block; margin-top: 6px; }
.card-choice input { position: absolute; opacity: 0; pointer-events: none; }

/* Styled dropdown (native selects are never used for a known choice set) */
.combo { position: relative; max-width: 620px; }
.combo-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line-grey); border-radius: 3px; background: #fff;
  padding: 10px 12px; font-size: 17px; line-height: 24px; cursor: pointer; width: 100%;
  font-family: var(--font); color: var(--navy); text-align: left;
}
.combo-field .caret { color: var(--accent); font-size: 13px; flex: 0 0 auto; }
.combo-field.placeholder { color: var(--text-grey); }
.combo-menu {
  position: absolute; z-index: 40; left: 0; right: 0; background: #fff;
  border: 1px solid var(--accent); border-radius: 3px; box-shadow: 0 12px 32px rgba(35,41,73,.16);
  padding: 4px 0; max-height: none; overflow: visible; min-width: 100%; width: max-content;
}
.combo-menu[hidden] { display: none; }
.combo-menu .combo-search { margin: 6px 8px 8px; width: calc(100% - 16px); }
.combo-menu .combo-list { list-style: none; margin: 0; padding: 0; max-width: none; }
.combo-menu .combo-opt {
  padding: 8px 14px; cursor: pointer; font-size: 16px; line-height: 23px; white-space: nowrap;
}
.combo-menu .combo-opt:hover, .combo-menu .combo-opt.active { background: var(--tint); color: var(--accent-dark); }
.combo-menu .combo-empty { padding: 8px 14px; color: var(--text-grey); font-size: 15px; }

/* Multi-select chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--tint);
  border: 1px solid var(--line-grey); border-radius: 3px; padding: 5px 8px 5px 12px; font-size: 15px;
}
.chip button { background: none; border: 0; cursor: pointer; color: var(--text-grey); font-size: 16px; line-height: 1; padding: 2px 4px; }
.chip button:hover { color: var(--error); }

/* Popups: movable, never scroll, round close hanging outside the corner */
.pop-backdrop {
  position: fixed; inset: 0; background: rgba(35,41,73,.42); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.pop {
  position: relative; background: #fff; border-radius: 3px; border: 1px solid var(--line-grey);
  box-shadow: 0 24px 60px rgba(35,41,73,.28); width: min(640px, 92vw);
  padding: 26px 28px 22px; overflow: visible;
}
.pop.pop-wide { width: min(880px, 94vw); }
.pop h2 { font-size: 24px; line-height: 30px; margin-bottom: 12px; }
.pop h2.error-head { color: var(--error); }
.pop-body { margin-bottom: 18px; }
.pop-body p:last-child { margin-bottom: 0; }
.pop-buttons { display: flex; align-items: center; gap: 14px; }
.pop-buttons .btn-tertiary { font-size: 13px; }
.pop-close {
  position: absolute; top: -16px; right: -16px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; border: 2px solid #fff; cursor: pointer;
  font-size: 17px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
  padding: 0; font-family: var(--font);
}
.pop-close:hover { background: var(--error); }
.pop-sizes { position: absolute; top: 10px; right: 34px; display: flex; align-items: flex-end; gap: 4px; }
.pop-sizes button {
  background: none; border: 0; cursor: pointer; color: var(--text-grey); font-family: var(--font);
  font-weight: 700; padding: 0 3px; line-height: 1;
}
.pop-sizes button:hover, .pop-sizes button[aria-pressed=true] { color: var(--accent); }
.pop-sizes button:nth-child(1) { font-size: 12px; }
.pop-sizes button:nth-child(2) { font-size: 15px; }
.pop-sizes button:nth-child(3) { font-size: 18px; }
.pop-record {
  background: var(--tint); border: 1px solid var(--line-grey); padding: 14px 16px; margin: 0 0 18px;
  font-size: 15px; line-height: 23px;
}
.pop-record dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.pop-record dt { font-weight: 600; }
.pop-record dd { margin: 0; }
.pop-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 3px; z-index: 120;
  font-size: 15px; box-shadow: 0 12px 30px rgba(35,41,73,.3);
}
.missing-list { list-style: none; padding: 0; margin: 0 0 4px; }
.missing-list li { font-weight: 600; margin-bottom: 10px; }
.missing-list .missing-input { margin-top: 6px; font-weight: 400; }

/* Skeletons */
.skeleton {
  background: #cdd3e2; border-radius: 3px; color: var(--navy); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  animation: nagta-pulse 1.4s ease-in-out infinite;
}
@keyframes nagta-pulse { 0%,100% { opacity: 1; } 50% { opacity: .62; } }

/* Footer */
.site-footer { background: var(--navy); color: #fff; padding: 46px 0 30px; margin-top: 0; }
.site-footer a { color: #DCE2F0; }
.site-footer a:hover { color: #fff; }
.footer-mark { font-weight: 700; font-size: 28px; line-height: 34px; margin: 0 0 12px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-cols h2 { font-size: 15px; line-height: 22px; margin: 0 0 10px; color: #fff; font-weight: 700; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 8px; font-size: 15px; line-height: 22px; }
.footer-id div { font-size: 15px; line-height: 23px; }
.footer-marketplaces { margin-top: 34px; border-top: 1px solid #3B4368; padding-top: 20px; font-size: 15px; line-height: 23px; }
.footer-marketplaces p { max-width: 92ch; margin: 8px 0 0; }
.footer-bottom { margin-top: 22px; font-size: 14px; line-height: 22px; color: #C6CDE2; }

/* Account dropdown (dashboard and admin) */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--navy);
  border: 1px solid var(--line-grey); border-radius: 4px; padding: 7px 12px; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 15px;
}
.acct-btn:hover { background: var(--tint); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line-grey);
  box-shadow: 0 12px 30px rgba(35,41,73,.18); border-radius: 4px; min-width: 220px; z-index: 60; padding: 6px 0;
}
.acct-menu[hidden] { display: none; }
.acct-menu a, .acct-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: var(--font); font-size: 15px; line-height: 22px; padding: 8px 16px;
  color: var(--navy); text-decoration: none;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--tint); }
.acct-menu .sep { border-top: 1px solid var(--line-grey); margin: 6px 0; }

/* Panel surfaces (dashboard and admin) */
.panel {
  border: 1px solid var(--line-grey); background: #fff; padding: 22px 24px; margin: 0 0 22px;
}
.panel > h2 { font-size: 22px; line-height: 28px; margin-bottom: 6px; }
.panel > h2 + .panel-sub { color: var(--text-grey); font-size: 15px; line-height: 23px; margin: 0 0 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.status-line { font-size: 19px; line-height: 28px; font-weight: 600; }
.badge {
  display: inline-block; background: var(--tint); border: 1px solid var(--accent); color: var(--accent-dark);
  border-radius: 3px; padding: 3px 10px; font-size: 14px; font-weight: 600;
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.empty-state { color: var(--text-grey); font-size: 16px; line-height: 25px; }
.inline-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.saved-flash { color: var(--accent-dark); font-weight: 600; font-size: 14px; }

/* Legal pages */
.legal { max-width: 860px; }
.legal h2 { font-size: 24px; line-height: 31px; margin: 34px 0 12px; }
.legal h3 { font-size: 19px; line-height: 26px; margin: 24px 0 10px; }
.legal p { font-size: 17px; line-height: 28px; }
.legal .legal-title { font-weight: 700; font-size: 22px; line-height: 30px; margin-bottom: 4px; }

@media (max-width: 900px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 32px; line-height: 38px; }
  h2 { font-size: 25px; line-height: 31px; }
  body { font-size: 16px; line-height: 26px; }
  .site-header .wrap-wide { flex-wrap: wrap; }
  .site-nav { gap: 18px; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .footer-cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
}
