/* landing.css — ITGATE landing/login and error pages. Self-contained, no
   external resources (strict CSP). Jeppesen ForeFlight palette. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --midnight: #001629;
  --afterburn: #FF791A;
  --deephorizon: #006379;
  --opensky: #19A2AE;
  --highvis: #6AF4F9;
  --avionic: #FFA05C;
  --cloud: #F3EDE2;

  --accent: var(--deephorizon);       /* links, focus */
  --cta: var(--afterburn);            /* primary buttons (midnight text) */
  --page-bg: var(--cloud);
  --panel-bg: #ffffff;
  --panel-border: #ddd5c6;
  --field-bg: #faf7f1;
  --text-0: var(--midnight);
  --text-1: #3f5062;
  --text-2: #5b6b7b;
  --danger-bg: #fdecea;
  --danger-border: #e5a39d;
  --danger-text: #8c1d14;
  --info-bg: #e3f4f5;
  --info-border: #8fcfd5;
  --info-text: #00424f;
  --hero-bg: linear-gradient(160deg, #fff3e6 0%, #ffffff 55%, #e3f4f5 100%);
  --shadow: 0 1px 2px rgba(0, 22, 41, .05), 0 8px 24px rgba(0, 22, 41, .08);

  /* Fluid sizing: the page, type and mascot grow with the viewport (phones to 4K) instead of stopping at a fixed width. */
  --page-max: clamp(1320px, 78vw, 2400px);
  --fs-base: clamp(15px, .5vw + 9px, 21px);
}

:root[data-theme="dark"] {
  --accent: var(--highvis);
  --page-bg: #000f1c;
  --panel-bg: #0a2237;
  --panel-border: #1c3a56;
  --field-bg: #04182a;
  --text-0: var(--cloud);
  --text-1: #c3cbd3;
  --text-2: #92a2b2;
  --danger-bg: #3a1512;
  --danger-border: #8c3a33;
  --danger-text: #ffb4ab;
  --info-bg: #07313d;
  --info-border: #19697a;
  --info-text: #b9f3f6;
  --hero-bg: linear-gradient(160deg, #0b2a44 0%, #001629 60%, #00323d 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: var(--fs-base); }
html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-0);
  font-family: var(--font);
  line-height: 1.4;
}

a { color: var(--accent); }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 300;
  padding: 8px 14px; border-radius: 8px;
  background: var(--afterburn); color: var(--midnight); font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* ---------- focus (shared) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--page-max); margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 56px) 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: clamp(40px, 2.6vw, 72px); width: auto; display: block; flex-shrink: 0; }
:root[data-theme="dark"] .brand-logo { filter: invert(1) brightness(1.9); }
.brand-text {
  display: flex; align-items: center; gap: 10px;
  border-left: 1px solid var(--panel-border); padding-left: 12px;
}
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: .08em; }

.version-badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  background: rgba(25, 162, 174, .16);
  background: color-mix(in srgb, var(--opensky) 16%, transparent);
  border: 1px solid rgba(25, 162, 174, .4);
  border: 1px solid color-mix(in srgb, var(--opensky) 40%, transparent);
}

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-1);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- page / hero ---------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: 22px clamp(16px, 4vw, 56px) 48px; }

.hero {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: clamp(28px, 5vw, 64px);
  background: var(--hero-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}
.hero-bokeh { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bokeh { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .3; }
.b1 { width: 140px; height: 140px; background: var(--avionic); top: -30px; left: 8%; }
.b2 { width: 90px; height: 90px; background: var(--opensky); bottom: 10%; left: 46%; }
.b3 { width: 110px; height: 110px; background: var(--highvis); top: 12%; right: 6%; }

.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center;
  gap: clamp(24px, 4vw, 48px);
}
.hero-copy h1 {
  margin: 0 0 14px; font-size: clamp(2rem, 3.2vw + .6rem, 4.2rem);
  font-weight: 750; line-height: 1.1; letter-spacing: -.01em;
}
.hero-copy h1 .accent { color: #c2500a; }
:root[data-theme="dark"] .hero-copy h1 .accent { color: var(--avionic); }
.subhead { margin: 0 0 22px; max-width: 44ch; font-size: clamp(1rem, .6vw + .75rem, 1.5rem); color: var(--text-1); line-height: 1.5; }

/* ---------- login box ---------- */
.login-box {
  width: 100%; max-width: clamp(400px, 26vw, 620px); min-height: 240px;
  padding: 22px; border-radius: 20px;
  background: var(--panel-bg); border: 1px solid var(--panel-border); box-shadow: var(--shadow);
}
.login-box-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.login-box-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); }

.login-choice-primary {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 100%; padding: 14px 16px; border-radius: 16px;
  background: var(--cta); color: var(--midnight);
  font-family: var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 121, 26, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.login-choice-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255, 121, 26, .38); }
.lc-title { font-size: 16px; font-weight: 750; }
.lc-sub { font-size: 12.5px; font-weight: 500; }

.login-choice-note { margin: 14px 0 12px; font-size: 13px; line-height: 1.5; color: var(--text-2); text-align: center; }

.login-alt {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 8px; font-size: 12px; color: var(--text-2);
}
.login-alt::before, .login-alt::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); }

.login-choice-rsa {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-0);
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
}
.login-choice-rsa:hover { border-color: var(--accent); }

.login-back {
  margin: 0 0 14px; padding: 4px 0; border: 0; background: transparent;
  color: var(--text-2); font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
}
.login-back:hover { color: var(--text-0); text-decoration: underline; }

.login-field { margin-bottom: 14px; }
.login-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 650; color: var(--text-1); }
.login-field input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--panel-border); background: var(--field-bg); color: var(--text-0);
  font-family: var(--font); font-size: 16px;
}
.login-field input::placeholder { color: var(--text-2); }
.login-code-input { letter-spacing: .3em; font-family: var(--mono); text-align: center; }

.login-submit, .btn-primary {
  display: inline-block; width: 100%; padding: 12px 18px; border: 0; border-radius: 999px;
  background: var(--cta); color: var(--midnight);
  font-family: var(--font); font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
}
.login-submit:hover, .btn-primary:hover { background: var(--avionic); }
.login-submit:disabled { opacity: .65; cursor: default; }

.btn-secondary {
  width: 100%; padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--panel-border); background: transparent; color: var(--text-0);
  font-family: var(--font); font-size: 15px; font-weight: 650; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); }

.authed-actions { display: flex; flex-direction: column; gap: 10px; }
.inline-form { margin: 0; }

.login-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--text-2); text-align: center; line-height: 1.5; }

.login-error, .login-notice {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.4; text-align: center;
}
.login-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-text); }
.login-notice { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text); }
#login-error { margin: 12px 0 0; }

/* ---------- mascot ---------- */
.mascot-wrap { position: relative; width: min(100%, clamp(340px, 24vw, 620px)); aspect-ratio: 1; margin: 0 auto; }
.mascot { width: 100%; height: 100%; display: block; object-fit: contain; }
.mascot-breathe { animation: mascot-breathe 4.2s ease-in-out infinite; }
@keyframes mascot-breathe { 50% { transform: scale(1.025) translateY(-3px); } }

.mascot-bubble {
  position: absolute; top: -10%; left: 42%; z-index: 2; width: min(76%, 220px);
  padding: 10px 14px; border-radius: 16px;
  background: var(--panel-bg); color: var(--text-0); border: 1px solid var(--panel-border); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translate(-50%, -10px) scale(.92);
  transition: opacity .25s ease, transform .25s ease;
}
.mascot-bubble p { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 600; text-align: center; }
.mascot-wrap.show-bubble .mascot-bubble { opacity: 1; transform: translate(-50%, 0) scale(1); }

.sparkle { position: absolute; pointer-events: none; animation: sparkle 2.6s ease-in-out infinite; }
.sparkle svg { width: 100%; height: 100%; display: block; }
.sparkle-1 { top: 16%; left: 76%; width: 20px; height: 20px; }
.sparkle-2 { top: 30%; left: 84%; width: 14px; height: 14px; animation-delay: 1.1s; }
@keyframes sparkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

.relief-badge {
  position: absolute; top: 4%; right: 6%; width: 40px; height: 40px; border-radius: 50%;
  background: #1f9d55; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(31, 157, 85, .35);
}
.relief-badge svg { width: 20px; height: 20px; }

.float-chip {
  position: absolute; width: 42px; height: 42px; border-radius: 12px;
  background: var(--panel-bg); border: 1px solid var(--panel-border); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.float-chip svg { width: 20px; height: 20px; }
.chip-a { top: 2%; left: -2%; color: var(--deephorizon); animation: chip 5s ease-in-out infinite; }
.chip-b { bottom: 14%; left: -6%; color: var(--afterburn); animation: chip 5.6s ease-in-out .6s infinite; }
.chip-c { bottom: -2%; right: 12%; color: var(--opensky); animation: chip 4.6s ease-in-out 1.1s infinite; }
.chip-d { top: 18%; right: -4%; color: var(--afterburn); animation: chip 5.2s ease-in-out 1.6s infinite; }
:root[data-theme="dark"] .chip-a { color: var(--highvis); }
@keyframes chip { 50% { transform: translateY(-10px) rotate(-3deg); } }

/* ---------- footer ---------- */
.page-foot {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--panel-border);
  text-align: center; font-size: 13px; color: var(--text-2);
}

/* ---------- error page ---------- */
.error-page { display: flex; justify-content: center; padding-top: 12vh; }
.error-card {
  width: 100%; max-width: 440px; padding: 32px; text-align: center;
  border-radius: 20px; background: var(--panel-bg); border: 1px solid var(--panel-border); box-shadow: var(--shadow);
}
.error-card .brand-logo { margin: 0 auto 18px; }
.error-card h1 { margin: 0 0 10px; font-size: 24px; }
.error-card p { margin: 0 0 22px; color: var(--text-1); line-height: 1.5; }

/* ---------- responsive / motion ---------- */
/* Short landscape screens (phones on their side, small laptops): tighter vertical rhythm so the sign-in box stays on screen. */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { padding: 20px 28px; }
  .mascot-wrap { width: min(100%, 200px); }
  .page-foot { margin-top: 20px; }
}
@media (max-width: 480px) {
  .topbar { padding-top: 14px; }
  .hero { border-radius: 20px; padding: 22px 16px; }
  .login-box { padding: 18px 16px; border-radius: 16px; }
  .mascot-wrap { width: min(60%, 200px); }
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .login-box { max-width: none; }
  .mascot-wrap { width: min(70%, 260px); order: -1; }
  .float-chip { display: none; }
  .brand-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Help window after a failed sign-in (the window itself is .itg-modal from notice.css) */
.login-help { margin: 10px 0 0; text-align: right; font-size: .75rem; }
.login-link { background: none; border: 0; padding: 2px 0; color: inherit; text-decoration: none; cursor: pointer; font: inherit; opacity: .6; }
.login-link:hover, .login-link:focus-visible { opacity: 1; text-decoration: underline; }
.itg-modal .help-list { margin: 8px 0 12px; padding-left: 20px; }
.itg-modal .help-list li { margin: 6px 0; }
.itg-modal .help-logo { display: block; height: 40px; width: auto; margin: 0 0 14px; }     /* the window is white in both themes: no dark-mode inversion */
