/* =========================================================
   SRAC Sign-Up — style.css
   Racing-themed, dark glassmorphism UI
   ========================================================= */

/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --nhra-red: #CE1126;
  --nhra-red-light: #E8293E;
  --nhra-blue: #003478;
  --nhra-blue-light: #1A4F9A;
  --accent-1: var(--nhra-red);
  --accent-2: var(--nhra-red-light);
  --accent-mid: #D91A30;
  /* Aliases — earlier code references these names; they now map to NHRA red */
  --orange-1: var(--nhra-red);
  --orange-2: var(--nhra-red-light);
  --orange-mid: #D91A30;
  --orange-deep: #A50E1E;
  --bg-deep: #060A14;
  --bg-mid: #0C1222;
  --bg-card: rgba(12, 18, 34, 0.88);
  --border-subtle: rgba(0, 52, 120, 0.35);
  --border-input: rgba(255, 255, 255, 0.10);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.62);
  --text-muted: rgba(240, 240, 245, 0.38);
  --input-bg: rgba(255, 255, 255, 0.055);
  --input-hover: rgba(255, 255, 255, 0.09);
  --input-focus: rgba(0, 52, 120, 0.18);
  --error-color: #ff5252;
  --success-color: var(--nhra-red);
  --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 52, 120, 0.25);
  --radius-card: 24px;
  --radius-input: 12px;
  --font: 'Outfit', system-ui, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Scene ─────────────────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Subtle track-stripe grid */
.track-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg,
      transparent,
      transparent 59px,
      rgba(255, 255, 255, 0.018) 59px,
      rgba(255, 255, 255, 0.018) 60px),
    repeating-linear-gradient(180deg,
      transparent,
      transparent 59px,
      rgba(255, 255, 255, 0.018) 59px,
      rgba(255, 255, 255, 0.018) 60px);
}

/* Ambient glow orbs */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}

.glow-1 {
  width: 700px;
  height: 700px;
  left: -200px;
  top: -100px;
  background: radial-gradient(circle, rgba(0, 52, 120, 0.35) 0%, transparent 70%);
  animation: floatOrb 14s ease-in-out infinite alternate;
}

.glow-2 {
  width: 600px;
  height: 600px;
  right: -150px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(206, 17, 38, 0.25) 0%, transparent 70%);
  animation: floatOrb 18s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(40px) scale(1.08);
  }
}

/* Particle dots */
.particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(206, 17, 38, 0.5);
  animation: particleFly linear infinite;
}

@keyframes particleFly {
  from {
    transform: translateY(0) translateX(0);
    opacity: 0.6;
  }

  to {
    transform: translateY(-120vh) translateX(20px);
    opacity: 0;
  }
}

/* ── Page Layout ──────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  gap: 28px;
}

/* ── NHRA Top Racing Stripe ───────────────────────────── */
/* Iconic red → white → blue band that runs across the top of every page */
.nhra-stripe {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 100;
  background: linear-gradient(90deg,
      var(--nhra-red) 0%,
      var(--nhra-red) 40%,
      #fff 40%,
      #fff 60%,
      var(--nhra-blue) 60%,
      var(--nhra-blue) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ── Site Header ──────────────────────────────────────── */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* White rounded "shield" container — makes the white-bg logo */
/* read intentional rather than like an unfinished cutout. */
.logo-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 18px 26px;
  border-radius: 18px;
  box-shadow:
    0 18px 48px rgba(0, 52, 120, 0.35),
    0 4px 14px rgba(206, 17, 38, 0.20),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  position: relative;
}

/* Red underline accent on the shield — echoes the logo's own red bar */
.logo-shield::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--nhra-red), transparent);
}

.logo-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
}

.header-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg,
      rgba(206, 17, 38, 0.85),
      rgba(0, 52, 120, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 20px;
  border-radius: 100px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* ── Card ─────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 620px;
  background: var(--bg-card);
  backdrop-filter: blur(36px) saturate(1.6);
  -webkit-backdrop-filter: blur(36px) saturate(1.6);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardRise 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Top accent bar — NHRA red/white/blue tri-stripe */
.card::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg,
      var(--nhra-red) 0%,
      var(--nhra-red) 40%,
      #fff 40%,
      #fff 60%,
      var(--nhra-blue) 60%,
      var(--nhra-blue) 100%);
}

/* Checkered-flag micro-pattern at the bottom of the card */
.card::after {
  content: '';
  display: block;
  height: 8px;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.35) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.35) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.35) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.35) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  background-color: var(--bg-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0.55;
}

@keyframes shimmerBar {
  from {
    background-position: 200% center;
  }

  to {
    background-position: -200% center;
  }
}

.card-inner {
  padding: 40px 44px 44px;
}

/* ── Card Header ──────────────────────────────────────── */
.card-header {
  margin-bottom: 32px;
}

.card-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--nhra-red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── Form ─────────────────────────────────────────────── */
.signup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row--split>* {
  flex: 1;
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.required {
  color: var(--nhra-red);
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color var(--transition);
  flex-shrink: 0;
}

.input-icon svg {
  width: 100%;
  height: 100%;
}

.form-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  font-family: var(--font);
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  outline: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover {
  background: var(--input-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.form-input:focus {
  background: var(--input-focus);
  border-color: var(--nhra-blue-light);
  box-shadow: 0 0 0 3px rgba(0, 52, 120, 0.22);
}

.form-input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--nhra-blue-light);
}

/* Select styling */
.select-wrapper {
  position: relative;
}

.form-select {
  cursor: pointer;
  padding-right: 42px;
}

.form-select option {
  background: #1a1a24;
  color: var(--text-primary);
}

.select-chevron {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition), transform var(--transition);
}

.select-chevron svg {
  width: 100%;
  height: 100%;
}

.form-select:focus~.select-chevron {
  color: var(--nhra-blue-light);
  transform: rotate(180deg);
}

/* Validation states */
.form-input.is-error,
.form-input.is-error:focus {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.16);
}

.field-error {
  font-size: 0.78rem;
  color: var(--error-color);
  font-weight: 500;
  min-height: 1em;
  margin-top: -3px;
}

/* Info box */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 52, 120, 0.08);
  border: 1px solid rgba(0, 52, 120, 0.22);
  border-radius: 12px;
  margin-top: 4px;
}

.info-icon {
  width: 18px;
  height: 18px;
  color: var(--nhra-blue-light);
  flex-shrink: 0;
  margin-top: 1px;
}

.info-icon svg {
  width: 100%;
  height: 100%;
}

.info-box p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 28px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--nhra-red) 0%, var(--nhra-red-light) 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 8px 32px rgba(206, 17, 38, 0.4);
  margin-top: 6px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(206, 17, 38, 0.55);
  filter: brightness(1.08);
}

.btn-primary:hover::before {
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 18px rgba(206, 17, 38, 0.35);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 16px rgba(206, 17, 38, 0.2);
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform var(--transition);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-spinner {
  position: relative;
  z-index: 1;
}

.spin-icon {
  width: 20px;
  height: 20px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nhra-blue-light);
  background: rgba(0, 52, 120, 0.1);
  border: 1px solid rgba(0, 52, 120, 0.3);
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  margin-top: 10px;
}

.btn-secondary:hover {
  background: rgba(0, 52, 120, 0.18);
  border-color: rgba(0, 52, 120, 0.5);
  transform: translateY(-1px);
}

/* Form-level error */
.form-error {
  font-size: 0.85rem;
  color: var(--error-color);
  text-align: center;
  padding: 10px 14px;
  background: rgba(255, 82, 82, 0.08);
  border: 1px solid rgba(255, 82, 82, 0.2);
  border-radius: 10px;
}

/* ── Success State ────────────────────────────────────── */
.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 10px;
  gap: 12px;
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-icon {
  width: 72px;
  height: 72px;
  animation: popIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

@keyframes popIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.success-title {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--nhra-red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-body {
  font-size: 0.96rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.6;
}

.success-note {
  font-size: 0.8rem;
  color: rgba(130, 170, 220, 0.85);
  background: rgba(0, 52, 120, 0.12);
  border: 1px solid rgba(0, 52, 120, 0.30);
  border-radius: 10px;
  padding: 10px 16px;
  max-width: 360px;
  line-height: 1.5;
  margin-top: 4px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: -3px;
}


/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.footer-note {
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 560px) {
  .card-inner {
    padding: 28px 22px 34px;
  }

  .form-row--split {
    flex-direction: column;
    gap: 20px;
  }

  .logo-img {
    max-width: 170px;
  }

  .logo-shield {
    padding: 14px 20px;
  }

  .card-title {
    font-size: 1.55rem;
  }

  .page-wrapper {
    padding: 24px 12px 48px;
    gap: 22px;
  }
}