/* Dingo's K'gari — Waivers Lookup Portal
   Mirrors the styling language of pages-aag-guest-portal so this
   feels like the same product family (same fonts, primary blue,
   card + panel geometry, header shape). Self-contained — no
   framework, no bundle. */

:root {
  --primary: #258ecc;
  --primary-contrast: #ffffff;
  --accent: #f59e0b;
  --bg: #eef3f9;
  --surface: rgba(255, 255, 255, 0.85);
  --card: #ffffff;
  --text: #1b2640;
  --muted: #44506e;
  --border: #c9d4e4;
  --shadow: 0 16px 36px rgba(22, 38, 68, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 142, 204, 0.18), rgba(37, 142, 204, 0) 36%),
    radial-gradient(circle at 86% 14%, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0) 30%),
    var(--bg);
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Header — matches the guest portal's inner-bar shape + colouring. */
.header {
  margin: 14px auto 0;
  max-width: 640px;
  padding: 0 18px;
}

.header-inner {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #172038);
  color: var(--primary-contrast);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  max-height: 40px;
  max-width: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.brand-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Buffer both sides so the centred title never overlaps the
     brand logo on the left (up to 140px wide + gap). */
  max-width: calc(100% - 180px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  font-family: "Outfit", "Trebuchet MS", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.container {
  max-width: 640px;
  margin: 18px auto 34px;
  padding: 0 18px;
}

/* Hero — Dingo's-branded background image with dark overlay + copy.
   Matches .login-hero on the guest portal. Uses the pages.dev URL
   for the guest portal's assets so it doesn't depend on the custom
   domain resolving (both worker deploys share the same fallback). */
.hero {
  min-height: 200px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background-image:
    linear-gradient(122deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.28)),
    url("/assets/brands/dingos/hero-login.jpg");
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), var(--shadow);
}

.hero-copy {
  max-width: 100%;
  font-family: "Outfit", "Trebuchet MS", sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.08;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Panels — white cards for each form step. Same rounded language
   as the guest portal's .panel + .trip-card families. */
.panel {
  background: var(--surface);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-family: "Outfit", "Trebuchet MS", sans-serif;
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: var(--text);
}

.panel p {
  margin: 0 0 12px;
  line-height: 1.5;
  font-size: 15px;
}

.muted { color: var(--muted); }

.form-stack {
  display: grid;
  gap: 12px;
}

.field {
  display: block;
  margin: 4px 0;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
  min-height: 44px;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}

/* OTP input — big spaced-out numbers so a 6-digit code reads at a
   glance and mistypes are visible. */
#verifyOtp {
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 18px;
  font-family: "Outfit", "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--primary) 25%, transparent);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.status {
  min-height: 20px;
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.status.err { color: #b91c1c; }
.status.ok  { color: #0f766e; }

.footnote {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.footnote a {
  color: var(--primary);
  text-decoration: underline;
}

/* ----- Mobile-first responsive tuning ------------------------------- */

/* Tablet / small laptop */
@media (max-width: 640px) {
  .header { padding: 0 12px; }
  .container { padding: 0 12px; margin: 14px auto 24px; }
  .panel { padding: 20px; border-radius: var(--radius-md); }
  .panel h2 { font-size: 24px; }
  .hero { min-height: 180px; padding: 18px; }
  .hero-copy { font-size: 24px; }
  .brand-logo { max-height: 34px; max-width: 110px; }
  .brand-copy {
    font-size: 17px;
    max-width: calc(100% - 140px);
  }
}

/* Phone portrait */
@media (max-width: 480px) {
  .header { padding: 0 10px; margin-top: 10px; }
  .container { padding: 0 10px; margin: 12px auto 20px; }
  .header-inner { padding: 12px 14px; min-height: 52px; }
  .panel { padding: 16px; }
  .panel h2 { font-size: 22px; }
  .panel p { font-size: 14px; }
  .hero { min-height: 150px; padding: 14px; border-radius: var(--radius-sm); }
  .hero-copy { font-size: 20px; }
  .brand-logo { max-height: 30px; max-width: 96px; }
  .brand-copy {
    font-size: 16px;
    max-width: calc(100% - 118px);
  }
  #verifyOtp { font-size: 20px; letter-spacing: 0.3em; }
  .btn { padding: 8px 14px; font-size: 15px; }
  .footnote { font-size: 12px; }
}

/* Very narrow (older iPhones, split-screen) — hide the centred title
   entirely if it can't fit alongside the logo, rather than truncating
   or overlapping. Logo alone communicates brand well enough. */
@media (max-width: 360px) {
  .brand-copy { display: none; }
  .brand-logo { max-height: 32px; max-width: 120px; }
  .hero-copy { font-size: 18px; }
  .panel h2 { font-size: 20px; }
}
