/* =============================================================================
   MangoServe landing — styled with the MangoBoost Design System tokens
   (mirrors ~/MangoCloud-Frontend/src/app/globals.css). Brand = mango amber
   ramp + navy/ink. Fonts: Anton (logo/display), Hanken Grotesk (body),
   JetBrains Mono (metrics). Light + dark via prefers-color-scheme.
   ============================================================================= */

:root {
  /* Mango amber ramp */
  --gold-400: #fbc53d;
  --gold-500: #f8b51b;
  --gold-600: #f5900b;
  --gold-ink: #b4740a;

  /* Navy / ink ramp */
  --navy-900: #0a0d1a;
  --navy-800: #14182e;
  --navy-700: #1c2140;
  --navy-600: #2d3b68;
  --slate: #9aa3c0;
  --fog: #f1f1f5;

  /* Signature mango gradient (theme-independent) */
  --gradient-brand: linear-gradient(135deg, #fbc53d 0%, #f5900b 100%);

  /* Semantic surfaces — LIGHT */
  --background: #f4f5f8;
  --foreground: #14182e;
  --card: #ffffff;
  --card-2: #f5f6fa;
  --muted-fg: #5a6180;
  --primary: #f8b51b;
  --primary-fg: #14182e;
  --link: #b4740a;
  --border: rgba(20, 24, 46, 0.1);
  --input: rgba(20, 24, 46, 0.16);
  --ring: #f8b51b;
  --success: #2fb37a;
  --danger: #e5555b;
  /* Amber accent that flips brighter on dark surfaces */
  --gold-accent: var(--gold-ink);
  --logo-style0: #4e4b48;
  --logo-style1: #ffb81c;

  --radius: 0.75rem;
  --shadow-card: 0 24px 60px -24px rgba(20, 24, 46, 0.35);
  --shadow-btn: 0 10px 24px -10px rgba(245, 144, 11, 0.6);
  font-synthesis: none;
}

/* Dark palette — applied for the "auto" theme when the OS is dark
   (unless the user forced light), and always when the user forced dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0a0d1a;
    --foreground: #f1f1f5;
    --card: #14182e;
    --card-2: #1c2140;
    --muted-fg: #9aa3c0;
    --link: #f8b51b;
    --border: rgba(255, 255, 255, 0.09);
    --input: rgba(255, 255, 255, 0.16);
    --shadow-card: 0 30px 70px -28px rgba(0, 0, 0, 0.7);
    --gold-accent: var(--gold-400);
  }
}
:root[data-theme="dark"] {
  --background: #0a0d1a;
  --foreground: #f1f1f5;
  --card: #14182e;
  --card-2: #1c2140;
  --muted-fg: #9aa3c0;
  --link: #f8b51b;
  --border: rgba(255, 255, 255, 0.09);
  --input: rgba(255, 255, 255, 0.16);
  --shadow-card: 0 30px 70px -28px rgba(0, 0, 0, 0.7);
  --gold-accent: var(--gold-400);
  --logo-style0: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection {
  background: var(--primary);
  color: var(--primary-fg);
}

/* Ambient brand glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 82% -8%, rgba(248, 181, 27, 0.22), transparent 70%),
    radial-gradient(48% 42% at -5% 108%, rgba(45, 59, 104, 0.28), transparent 72%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bg-glow {
    background:
      radial-gradient(55% 45% at 82% -8%, rgba(248, 181, 27, 0.16), transparent 70%),
      radial-gradient(48% 42% at -5% 108%, rgba(76, 134, 240, 0.14), transparent 72%);
  }
}
:root[data-theme="dark"] .bg-glow {
  background:
    radial-gradient(55% 45% at 82% -8%, rgba(248, 181, 27, 0.16), transparent 70%),
    radial-gradient(48% 42% at -5% 108%, rgba(76, 134, 240, 0.14), transparent 72%);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px clamp(20px, 5vw, 48px) 18px;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: 30px;
  width: auto;
}

.brand__word {
  font-family: "Anton", ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand__mango {
  color: var(--foreground);
}
.brand__boost {
  color: var(--gold-500);
}

.topbar__product {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-fg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.theme-toggle__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  color: var(--muted-fg);
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease;
}
.theme-toggle__btn:hover {
  color: var(--foreground);
}
.theme-toggle__btn[aria-checked="true"] {
  color: var(--primary-fg);
  background: var(--gradient-brand);
}
.theme-toggle__btn svg {
  width: 16px;
  height: 16px;
}
.theme-toggle__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ---------- Main layout ---------- */
.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(12px, 2vh, 32px) 0;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-accent);
  background: color-mix(in srgb, var(--gold-500) 15%, transparent);
  padding: 6px 13px;
  border-radius: 999px;
}
.eyebrow__icon {
  width: 14px;
  height: 14px;
}

.hero__title {
  margin: 0;
  font-size: clamp(3.1rem, 5.4vw, 9.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(2.1rem, 4.4vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--muted-fg);
}

/* ---------- Signup ---------- */
.signup {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease;
}
.field:focus-within {
  border-color: color-mix(in srgb, var(--gold-500) 55%, var(--border));
}
.field__icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--muted-fg);
  pointer-events: none;
  transition: color 0.18s ease;
}
.field:focus-within .field__icon {
  color: var(--gold-accent);
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
  padding: 16px 20px 16px 48px;
  border-radius: 999px;
}
.field input:focus {
  outline: none;
}
.field input::placeholder {
  color: var(--muted-fg);
}

.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-fg);
  background: var(--gradient-brand);
  padding: 16px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-btn);
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}
.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.btn__icon {
  width: 17px;
  height: 17px;
  transition: transform 0.18s ease;
}
.btn:hover .btn__icon {
  transform: translateX(2px);
}

/* ---------- Social sign-in ---------- */
.signup__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted-fg);
  font-size: 0.8rem;
}
.signup__divider::before,
.signup__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.oauth-buttons {
  display: flex;
  gap: 10px;
}
.oauth-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 18px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.oauth-btn:hover {
  border-color: color-mix(in srgb, var(--gold-500) 55%, var(--border));
  transform: translateY(-1px);
}
.oauth-btn:active {
  transform: translateY(1px);
}
.oauth-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.signup__note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 11px 6px 0;
  font-size: 0.86rem;
  color: var(--muted-fg);
  min-height: 1.2em;
  transition: color 0.15s ease;
}
.signup__note-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.signup__note.is-ok {
  color: var(--success);
  font-weight: 600;
}
.signup__note.is-err {
  color: var(--danger);
  font-weight: 600;
}

/* ---------- Perks ---------- */
.perks {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.perk {
  display: flex;
  align-items: center;
  gap: 13px;
}
.perk__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--gold-accent);
  background: color-mix(in srgb, var(--gold-500) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold-500) 24%, transparent);
}
.perk__icon svg {
  width: 19px;
  height: 19px;
}
.perk__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.perk__text strong {
  font-weight: 700;
  font-size: 0.98rem;
}
.perk__text small {
  color: var(--muted-fg);
  font-size: 0.83rem;
}

/* ---------- Signup panel (right column) ---------- */
.signup-panel {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 440px;
}
.signup-panel__glow {
  position: absolute;
  inset: -12% -6% -6%;
  z-index: -1;
  border-radius: 40px;
  background: radial-gradient(70% 60% at 60% 20%, rgba(248, 181, 27, 0.2), transparent 70%);
  filter: blur(10px);
}
.signup-panel__inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.8);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.signup-panel__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.signup-panel__sub {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--muted-fg);
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted-fg);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.foot__dot {
  opacity: 0.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .signup-panel {
    justify-self: stretch;
    max-width: none;
  }
  .signup-panel__glow {
    display: none;
  }
}

@media (max-width: 540px) {
  .topbar__product {
    display: none;
  }
}

/* Short laptop screens (e.g. 1366×768) — compact the vertical rhythm so the
   hero, form, perks and footer all stay above the fold. */
@media (min-width: 901px) and (max-height: 800px) {
  .shell {
    padding: 8px 0;
  }
  .hero {
    gap: 14px;
  }
  .hero__title {
    font-size: clamp(1.9rem, 6.4vw, 9.6rem);
  }
  .hero__lede {
    font-size: 1rem;
  }
  .perks {
    gap: 10px;
  }
  .perk__icon {
    width: 36px;
    height: 36px;
  }
  .signup-panel__inner {
    padding: 22px;
  }
}

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