:root {
  --navy-950: #070b1c;
  --navy-900: #0d1330;
  --navy-800: #141c44;
  --navy-600: #27366f;
  --gold-600: #d99a1b;
  --gold-500: #f2b234;
  --gold-400: #f6c35d;
  --cream-50: #faf9f6;
  --font-display: 'Archivo', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--cream-50);
  background-color: var(--navy-950);
  background-image:
    radial-gradient(ellipse 60% 55% at 78% 50%, rgba(51, 68, 138, 0.38), transparent 70%),
    radial-gradient(ellipse 70% 55% at 85% 115%, rgba(242, 178, 52, 0.14), transparent 70%),
    radial-gradient(ellipse 55% 50% at 0% 0%, rgba(51, 68, 138, 0.42), transparent 70%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 60%);
  -webkit-font-smoothing: antialiased;
}

/* Film grain on top of the gradient (an inline SVG, no request). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  max-width: 1240px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 4rem) var(--gutter);
  /* The pitch lines never make the page scroll. */
  overflow: hidden;
}

/* ── Left: big editorial type ── */
.login-hero,
.login-panel {
  position: relative;
  min-width: 0;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2.25rem, 7vh, 5rem);
}

.hero-logo {
  width: auto;
  height: 40px;
  /* The logo is drawn for light backgrounds. */
  filter: brightness(0) invert(1);
}

.hero-divider {
  width: 1px;
  height: 36px;
  background: rgba(250, 249, 246, 0.28);
}

.hero-crest {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.hero-eyebrow::before {
  content: '';
  flex-shrink: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--gold-500);
}

.hero-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-size: clamp(2.5rem, 6.4vw, 6.1rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero-title-gold {
  color: var(--gold-500);
}

.hero-lede {
  max-width: 36ch;
  margin-top: 1.75rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(242, 178, 52, 0.45);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.6;
  color: rgba(250, 249, 246, 0.74);
  text-wrap: pretty;
}

/* ── Right: the sign-in card, inside a centre circle of a pitch ── */
.login-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pitch-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, 52vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(250, 249, 246, 0.08);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ring-in 1100ms var(--ease-out) 150ms both;
}

/* Halfway line and centre spot. */
.pitch-ring::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -35%;
  bottom: -35%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(250, 249, 246, 0.07) 30%, rgba(250, 249, 246, 0.07) 70%, transparent);
}

.pitch-ring::after {
  content: '';
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1px dashed rgba(242, 178, 52, 0.12);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: clamp(1.75rem, 3vw, 2.6rem);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 28, 68, 0.94), rgba(13, 19, 48, 0.97));
  border: 1px solid rgba(250, 249, 246, 0.1);
  box-shadow:
    0 1px 0 rgba(250, 249, 246, 0.08) inset,
    0 0 0 6px rgba(7, 11, 28, 0.35),
    0 40px 90px -20px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Gold bar on top of the card, like the site's section headers. */
.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
}

.card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(250, 249, 246, 0.06);
  border: 1px solid rgba(250, 249, 246, 0.1);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 249, 246, 0.7);
}

.card-eyebrow svg {
  color: var(--gold-400);
}

.card-title {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 120;
  font-weight: 900;
  font-size: clamp(2.1rem, 1.8rem + 1vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
}

.card-sub {
  margin: 0.75rem 0 1.75rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(250, 249, 246, 0.75);
}

.card-sub strong {
  color: var(--cream-50);
  white-space: nowrap;
}

.login-error {
  display: none;
  margin-bottom: 1.1rem;
  padding: 0.75rem 0.9rem 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #fde2e2;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-left: 4px solid #f87171;
}

.login-error strong {
  display: block;
  margin-bottom: 0.1rem;
  color: #fff;
}

/* The server redirects to /login.html#erro-<code>; show the matching message
   without any script (the CSP only allows same-origin files). */
.login-error:target {
  display: block;
  animation: rise 420ms var(--ease-out) 450ms both;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 56px;
  padding: 0.5rem 1.1rem 0.5rem 0.5rem;
  border-radius: 13px;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 110;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy-950);
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 12px 28px -10px rgba(242, 178, 52, 0.65);
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    filter 160ms var(--ease-out);
}

.login-btn-g {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(7, 11, 28, 0.25);
}

.login-btn-text {
  flex: 1;
  white-space: nowrap;
}

.login-btn-arrow {
  flex-shrink: 0;
  transition: transform 200ms var(--ease-out);
}

.login-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 16px 34px -10px rgba(242, 178, 52, 0.8);
}

.login-btn:hover .login-btn-arrow {
  transform: translateX(3px);
}

.login-btn:active {
  transform: translateY(1px) scale(0.99);
}

.login-btn:focus-visible {
  outline: 3px solid var(--cream-50);
  outline-offset: 3px;
}

.card-foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(250, 249, 246, 0.08);
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(250, 249, 246, 0.52);
}

/* ── Motion on load: a short rise, staggered (CSS only) ── */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ring-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.rise {
  animation: rise 640ms var(--ease-out) both;
}

.rise-1 { animation-delay: 0ms; }
.rise-2 { animation-delay: 80ms; }
.rise-3 { animation-delay: 140ms; }
.rise-4 { animation-delay: 210ms; }
.rise-5 { animation-delay: 290ms; }

.rise-card {
  animation: card-in 720ms var(--ease-out) 220ms both;
}

/* ── Narrow screens: one column, type on top ── */
@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 2.25rem;
  }

  .hero-brand {
    margin-bottom: 1.75rem;
  }

  .hero-title {
    font-size: clamp(2rem, 12.6vw, 5.5rem);
  }

  .hero-lede {
    margin-top: 1.1rem;
  }

  .login-panel {
    justify-content: stretch;
  }

  .login-card {
    max-width: none;
  }

  .pitch-ring {
    width: min(520px, 120vw);
  }
}

@media (max-width: 420px) {
  .hero-eyebrow {
    gap: 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .hero-eyebrow::before {
    width: 1.5rem;
  }

  .hero-lede {
    font-size: 0.93rem;
  }

  .login-card {
    padding: 1.6rem 1.25rem 1.4rem;
    border-radius: 18px;
  }

  .login-btn {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 360px) {
  .login-btn {
    gap: 0.6rem;
    padding-right: 0.8rem;
    font-size: 0.82rem;
  }

  .login-btn-g {
    width: 34px;
    height: 34px;
  }

  .login-btn-arrow {
    display: none;
  }

  .hero-logo {
    height: 32px;
  }

  .hero-crest {
    width: 36px;
    height: 36px;
  }

  .hero-eyebrow {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }

  .hero-eyebrow::before {
    width: 1rem;
  }

  .card-sub strong {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rise,
  .rise-card,
  .pitch-ring,
  .login-error:target {
    animation: none;
  }

  .login-btn,
  .login-btn-arrow {
    transition: none;
  }
}
