/*
  Keelcheck public site: landing page, help, legal, security, status, password reset.
  Shared by app/templates/public_base.html.
  Palette taken from the International Code "K" flag (yellow hoist, blue fly),
  on chart-water blues. Edit the tokens below to adjust the whole page.
*/
:root {
  --flag-yellow: #F2C200;
  --flag-yellow-deep: #D9AD00;
  --flag-blue: #1F4E9E;
  --flag-blue-deep: #173C7A;
  --ink: #13283A;
  --ink-soft: #46596B;
  --water-shallow: #DCEBF3;
  --water-mid: #EAF3F8;
  --deep: #FFFFFF;
  --line: #C6D7E2;
  --overdue: #B8322A;
  --due: #A86A00;
  --ok: #2B7A55;
  --radius: 6px;
  --wrap: 1120px;
  --display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--flag-blue); text-underline-offset: 3px; }
a:hover { color: var(--flag-blue-deep); }
:focus-visible { outline: 3px solid var(--flag-blue); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -0.005em; }
h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); max-width: 22ch; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 58ch; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  font-family: var(--body); font-weight: 600; font-size: 1rem;
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--flag-yellow); color: var(--ink); border-color: var(--flag-yellow); }
.btn-primary:hover { background: var(--flag-yellow-deep); border-color: var(--flag-yellow-deep); color: var(--ink); }
.btn-secondary { background: transparent; color: var(--flag-blue); border-color: var(--flag-blue); }
.btn-secondary:hover { background: var(--flag-blue); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-flag { width: 30px; height: 20px; flex: none; box-shadow: 0 0 0 1px rgba(19,40,58,.15); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: .005em; }
.main-nav { display: flex; gap: 26px; margin-left: 16px; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.main-nav a:hover { color: var(--flag-blue); text-decoration: underline; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.login-link { font-weight: 600; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: var(--radius); }
.login-link:hover { color: var(--flag-blue); background: var(--water-mid); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 42px; height: 40px; cursor: pointer; color: var(--ink); }
.mobile-nav { display: none; border-top: 1px solid var(--line); background: #fff; }
.mobile-nav a { display: block; padding: 14px 20px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--water-shallow); }
.mobile-nav.open { display: block; }
@media (max-width: 860px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .header-inner { gap: 10px; }
}
.login-link { white-space: nowrap; }
@media (max-width: 480px) {
  .header-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-flag { width: 24px; height: 16px; }
  .brand-name { font-size: 1.2rem; }
  .header-actions { gap: 4px; }
  .login-link { padding: 8px 6px; }
  .header-actions .btn-sm { padding: 0 12px; font-size: .9rem; }
  .menu-btn { width: 38px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--water-mid); border-bottom: 1px solid var(--line); }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 76px 20px 84px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); max-width: 15ch; }
.hero .lede { margin-top: 22px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 18px; color: var(--ink-soft); font-size: .98rem; }
.hero-note a { font-weight: 600; }
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; padding: 52px 20px 60px; }
}

/* Product panel in hero */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -22px rgba(19,40,58,.35);
  overflow: hidden;
}
.panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-top strong { font-family: var(--display); font-size: 1.2rem; }
.panel-top span { color: var(--ink-soft); font-size: .9rem; }
.tallies { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tally { padding: 14px 20px; border-right: 1px solid var(--line); }
.tally:last-child { border-right: 0; }
.tally b { display: block; font-family: var(--display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tally small { color: var(--ink-soft); font-size: .88rem; }
.tally.overdue b { color: var(--overdue); }
.tally.due b { color: var(--due); }
.tally.ok b { color: var(--ok); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 13px 20px; border-bottom: 1px solid var(--water-shallow); }
.row:last-child { border-bottom: 0; }
.row-item { font-weight: 600; }
.row-vessel { color: var(--ink-soft); font-size: .92rem; grid-column: 1; }
.status { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .88rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.status.overdue { color: var(--overdue); background: #F8E3E1; }
.status.due { color: var(--due); background: #FBEFD6; }
.status.ok { color: var(--ok); background: #DFF0E7; }
.panel-foot { padding: 12px 20px; background: var(--water-mid); color: var(--ink-soft); font-size: .88rem; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .js .row { opacity: 0; transform: translateY(6px); animation: rowIn .45s ease forwards; }
  .js .row:nth-child(1) { animation-delay: .25s; }
  .js .row:nth-child(2) { animation-delay: .4s; }
  .js .row:nth-child(3) { animation-delay: .55s; }
  .js .row:nth-child(4) { animation-delay: .7s; }
  .js .row:nth-child(5) { animation-delay: .85s; }
  @keyframes rowIn { to { opacity: 1; transform: none; } }
}

/* Sections */
section { padding: 92px 0; }
.section-head { margin-bottom: 44px; }
.section-head .lede { margin-top: 16px; }
@media (max-width: 700px) { section { padding: 64px 0; } }

/* Who it's for */
.for { padding: 34px 0; border-bottom: 1px solid var(--line); }
.for-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; }
.for-inner p { font-weight: 600; }
.for-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.for-list li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .95rem; }

/* How it works: a real sequence, so numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.step { padding: 22px 24px 0 0; counter-increment: step; }
.step::before { content: counter(step); display: block; font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--flag-blue); margin-bottom: 14px; }
.step p { margin-top: 8px; color: var(--ink-soft); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 32px; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Features */
.features { background: var(--water-mid); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 40px; }
.feature { border-left: 3px solid var(--flag-yellow); padding-left: 18px; }
.feature p { margin-top: 8px; color: var(--ink-soft); }
.feature-layout .section-head { position: sticky; top: 110px; align-self: start; margin-bottom: 0; }
@media (max-width: 900px) {
  .feature-layout { grid-template-columns: 1fr; gap: 36px; }
  .feature-layout .section-head { position: static; }
}
@media (max-width: 600px) { .feature-list { grid-template-columns: 1fr; } }

/* Honest note */
.straight { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.straight ul { margin: 0; padding: 0; list-style: none; }
.straight li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.straight li:first-child { border-top: 1px solid var(--line); }
.straight li strong { display: block; }
.straight li span { color: var(--ink-soft); }
@media (max-width: 860px) { .straight { grid-template-columns: 1fr; gap: 32px; } }

/* Pricing */
.pricing { background: var(--flag-blue); color: #fff; }
.pricing h2 { color: #fff; }
.pricing .lede { color: #D3E0F3; }
.billing { display: inline-flex; margin-top: 28px; background: var(--flag-blue-deep); border-radius: 999px; padding: 4px; }
.billing button {
  border: 0; background: transparent; color: #D3E0F3; font: 600 .98rem var(--body);
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
}
.billing button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.billing button:focus-visible { outline-color: var(--flag-yellow); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; align-items: stretch; }
.plan { background: #fff; color: var(--ink); border-radius: 10px; padding: 28px 26px 26px; display: flex; flex-direction: column; }
.plan.featured { box-shadow: 0 0 0 4px var(--flag-yellow); }
.plan h3 { font-size: 1.6rem; }
.plan .vessels { color: var(--ink-soft); margin-top: 4px; }
.price { margin-top: 22px; display: flex; align-items: baseline; gap: 6px; }
.price b { font-family: var(--display); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.price span { color: var(--ink-soft); }
.price-note { margin-top: 6px; font-size: .92rem; color: var(--ink-soft); min-height: 2.8em; }
.plan ul { list-style: none; margin: 20px 0 26px; padding: 0; flex: 1; }
.plan li { padding: 7px 0 7px 26px; position: relative; border-top: 1px solid var(--water-shallow); }
.plan li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 12px; height: 7px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.plan .btn { width: 100%; }
.pricing-foot { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; color: #D3E0F3; }
.pricing-foot strong { color: #fff; }
.pricing-foot a { color: #fff; }
.pricing .btn-secondary { color: var(--flag-blue); }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 460px; } .pricing-foot { grid-template-columns: 1fr; } }

/* Support and contact */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.channels { list-style: none; margin: 28px 0 0; padding: 0; }
.channels li { display: grid; grid-template-columns: 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); }
.channels li:first-child { border-top: 1px solid var(--line); }
.channels strong { font-size: 1.05rem; }
.channels span { color: var(--ink-soft); }
.form { background: var(--water-mid); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.form h3 { margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #A9C0CF; border-radius: var(--radius); padding: 11px 12px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--flag-blue); outline-offset: 0; border-color: var(--flag-blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 14px; font-weight: 500; min-height: 1.5em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--overdue); }
.form small { display: block; margin-top: 12px; color: var(--ink-soft); }
@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } .form { padding: 20px; } }

/* FAQ */
.faq { background: var(--water-mid); border-top: 1px solid var(--line); }
.faq-list { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-weight: 600; font-size: 1.1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 26px; width: 10px; height: 10px; border-right: 2px solid var(--flag-blue); border-bottom: 2px solid var(--flag-blue); transform: rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 31px; }
.faq details p { padding: 0 0 22px; color: var(--ink-soft); max-width: 68ch; }

/* Closing CTA */
.closing { padding: 80px 0; }
.closing-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; border-top: 2px solid var(--ink); padding-top: 40px; }
.closing h2 { max-width: 18ch; }
.closing .hero-ctas { margin-top: 0; }

/* Footer */
.site-footer { background: var(--ink); color: #C9D5DF; padding: 56px 0 36px; font-size: .96rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-grid h4 { margin: 0 0 12px; font-family: var(--body); font-size: .95rem; color: #fff; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-brand p { margin-top: 12px; max-width: 32ch; }
.footer-brand .brand { color: #fff; }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid #2C4256; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Content pages (help, terms, privacy, security, status) ---------- */
.page-hero { background: var(--water-mid); border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); max-width: 24ch; }
.page-hero .lede { margin-top: 14px; }
.page-meta { margin-top: 16px; color: var(--ink-soft); font-size: .95rem; }
.page-meta p + p { margin-top: 4px; }
.review-note { display: inline-block; margin-top: 12px; padding: 6px 12px; border-left: 3px solid var(--flag-yellow); background: #fff; color: var(--ink); font-size: .95rem; }
.prose { max-width: 760px; padding: 48px 20px 80px; }
.prose h2 { font-size: 1.75rem; max-width: none; margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 36px; background: var(--water-mid); }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; }
.help-steps { list-style: none; padding: 0; counter-reset: hs; }
.help-steps > li { counter-increment: hs; border-top: 1px solid var(--line); padding: 22px 0 8px 56px; position: relative; }
.help-steps > li::before { content: counter(hs); position: absolute; left: 0; top: 18px; font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--flag-blue); }
.help-steps h2 { margin: 0 0 8px; font-size: 1.4rem; }
.callout { margin-top: 36px; padding: 20px 22px; border-radius: var(--radius); background: var(--water-mid); border: 1px solid var(--line); font-weight: 500; }

/* Status */
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.status-list li:first-child { border-top: 1px solid var(--line); }
.status-list small { grid-column: 1; color: var(--ink-soft); }
.status-list .status { grid-row: 1 / span 2; grid-column: 2; }
.status.unknown { color: var(--ink-soft); background: var(--water-shallow); }

/* Small forms (password reset) */
.form-page { padding: 56px 20px 88px; max-width: 520px; }
.form-page h1 { font-size: 2.2rem; margin-bottom: 12px; }
.form-page .lede { font-size: 1.05rem; margin-bottom: 24px; }
.form-page .btn { width: 100%; }
.notice { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 500; }
.notice.ok { background: #DFF0E7; color: #1E5A3E; }
.notice.err { background: #F8E3E1; color: #8C241E; }
.form-page .after { margin-top: 18px; color: var(--ink-soft); }
