/* ════════════════════════════════════════════════════════════════
   tripoli.dev — Complete Design System
   ════════════════════════════════════════════════════════════════ */

/* ── Font Faces (#9: Italic variants removed — not in use. Re-add if italic style is introduced) ── */
@font-face {
  font-family: 'Hagrid';
  src: url('hagrid/Hagrid-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Hagrid Text';
  src: url('hagrid/Hagrid-Text-Extrabold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ── */
:root {
  --bg: #0a0a0a;
  --surface: #112D4E;
  --accent: #3F72AF;
  --muted: #DBE2EF;
  --text: #F9F7F7;
  --input-bg: rgba(255, 255, 255, 0.04);
  --error: #e05555;
  --success: #4caf7d;
  --radius: 12px;
  --font-display: 'Hagrid', 'Georgia', 'Times New Roman', serif;
  --font-bold: 'Hagrid Text', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Animations ── */

/* Shared entrance animation (hero timed, sections on scroll, steps staggered) */
.hero-anim,
.fade-in,
.fade-in-step {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.hero-anim.visible,
.fade-in.visible,
.fade-in-step.visible {
  opacity: 1;
  transform: translateY(0);
}

/* #10: Spinner */

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

/* ════════════════════════════════════════════════════════════════
   #4: TOP BAR — Sticky + Blur
   ════════════════════════════════════════════════════════════════ */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 226, 239, 0.08);
}

.top-bar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  min-height: 62px;
}

.top-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.top-bar__logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.top-bar__wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  position: relative;
}

.top-bar__brand:hover .top-bar__wordmark::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.7;
}

.top-bar__brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════
   #1–3, #4, #14, #20: HERO
   ════════════════════════════════════════════════════════════════ */
.hero {
  min-height: calc(100vh - 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px 40px;
  /* Layered radial glows for atmospheric depth */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(63, 114, 175, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 20%, rgba(63, 114, 175, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 70% 10%, rgba(100, 140, 200, 0.05) 0%, transparent 35%);
}

/* #2: Headline */
.hero__heading {
  font-family: var(--font-bold);
  font-weight: 800;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  /* Subtle gradient text: white to slightly muted */
  background: linear-gradient(180deg, #FFFFFF 0%, #C8D0DC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero__accent {
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}

/* #3: Subheadline */
.hero__sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 2vw, 18px);
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 0;
  line-height: 1.6;
}

.hero__sub strong {
  font-family: var(--font-bold);
  font-weight: 800;
  color: var(--accent);
}

/* #4: Emotional copy */
.hero__emotional {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(13px, 1.5vw, 15px);
  color: rgba(219, 226, 239, 0.55);
  max-width: 420px;
  margin-top: 10px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* #1: Hero CTA */
.hero__cta {
  display: inline-block;
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-bold);
  font-size: 16px;
  font-weight: 800;
  padding: 14px 36px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: filter 250ms ease, box-shadow 250ms ease;
}

.hero__cta:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 20px rgba(63, 114, 175, 0.45);
}

.hero__cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.hero__cta:active {
  transform: scale(0.985);
}

/* ════════════════════════════════════════════════════════════════
   #5: ALIAS EXPLAINER
   ════════════════════════════════════════════════════════════════ */
.explainer {
  max-width: 560px;
  margin: 0 auto 56px;
  border-left: 1px solid rgba(219, 226, 239, 0.08);
  padding-left: 16px;
}

.explainer__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text);
  margin-bottom: 8px;
}

.explainer__body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: rgba(219, 226, 239, 0.65);
  line-height: 1.7;
}

.explainer__body code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(63, 114, 175, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════
   #12, #13: HOW IT WORKS
   ════════════════════════════════════════════════════════════════ */
.steps {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* #13: Eyebrow title */
.steps__eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 48px;
}

.steps__row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
}

/* #12: Step cards */
.steps__card {
  position: relative;
  flex: 1;
  max-width: 300px;
  background: rgba(17, 45, 78, 0.40);
  border: 1px solid rgba(219, 226, 239, 0.08);
  border-radius: 12px;
  padding: 32px 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.steps__card:hover {
  transform: translateY(-4px);
  border-color: rgba(63, 114, 175, 0.25);
  box-shadow: 0 12px 32px rgba(63, 114, 175, 0.15);
}

/* Step number badge */
.steps__number {
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 0.04em;
}

.steps__icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(63, 114, 175, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
}

.steps__icon-badge svg {
  width: 28px;
  height: 28px;
}

.steps__label {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 10px;
}

.steps__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  opacity: 0.8;
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════════
   #6: SOCIAL PROOF
   ════════════════════════════════════════════════════════════════ */
.social-proof {
  text-align: center;
  padding: 0 24px 40px;
}

.social-proof__eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.social-proof__count {
  font-family: var(--font-bold);
  font-weight: 800;
  font-size: clamp(64px, 8vw, 96px);
  color: var(--text);
  line-height: 1;
  margin: 16px 0 12px;
}

.social-proof__sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: rgba(219, 226, 239, 0.55);
}

/* ════════════════════════════════════════════════════════════════
   #5–11: APPLICATION FORM
   ════════════════════════════════════════════════════════════════ */
.form-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 48px;
}

.form-card {
  background: var(--surface);
  border: 1px solid rgba(63, 114, 175, 0.20);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 56px);
  /* Lifted card with accent glow */
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(63, 114, 175, 0.08),
    0 0 80px -20px rgba(63, 114, 175, 0.10);
}

.form-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

/* #7: Required note */
.form-card__required-note {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.5;
  margin-bottom: 32px;
}

/* ── Form Layout (#9) ── */
#application-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Field Group ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* #7: Labels */
.field-group__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

.field-group__req {
  color: var(--error);
  font-size: 13px;
  margin-left: 4px;
  font-weight: 400;
}

.field-group__optional {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  opacity: 0.55;
}

/* Input wrapper (for checkmark positioning) */
.field-group__input-wrap {
  position: relative;
}

/* #5: Inputs */
.field-group__input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(219, 226, 239, 0.30);
  border-radius: 6px;
  padding: 12px 16px;
  padding-right: 40px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field-group__input::placeholder {
  color: rgba(249, 247, 247, 0.45);
}

.field-group__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 114, 175, 0.18);
}

.field-group__input.has-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(224, 85, 85, 0.12);
}

/* #6: Textareas */
.field-group__textarea {
  resize: vertical;
  min-height: 120px;
}

.field-group__textarea--short {
  min-height: 100px;
}

/* #8: Validation checkmark */
.field-group__check {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--success);
  font-size: 16px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.field-group__check--textarea {
  top: 16px;
  transform: none;
}

.field-group__check.show {
  opacity: 1;
}

/* Hint text */
.field-group__hint {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.45;
}

/* #8: Error messages */
.field-group__error {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--error);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 200ms ease, max-height 200ms ease;
}

.field-group__error.show {
  opacity: 1;
  max-height: 40px;
}

/* #2: Turnstile widget spacing */
.cf-turnstile {
  margin: 8px 0 16px;
}

/* Turnstile error hint */
.turnstile-error {
  margin-top: -8px;
  margin-bottom: 8px;
}

/* #8: Form error banner */
.form-error-banner {
  background: rgba(224, 85, 85, 0.10);
  border: 1px solid rgba(224, 85, 85, 0.30);
  color: #e05555;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 16px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

.form-error-banner.visible {
  opacity: 1;
  max-height: 100px;
}

/* ── #10: Submit Button ── */
.form-card__submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 8px;
  font-family: var(--font-bold);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 250ms ease, box-shadow 250ms ease, transform 100ms ease;
}

.form-card__submit:hover {
  filter: brightness(1.18);
  box-shadow: 0 0 24px rgba(63, 114, 175, 0.50);
}

.form-card__submit:active {
  transform: scale(0.985);
}

.form-card__submit:disabled {
  background: rgba(63, 114, 175, 0.45);
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.form-card__submit:disabled:hover {
  filter: none;
  box-shadow: none;
}

/* Spinner (hidden by default) */
.form-card__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(249, 247, 247, 0.3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form-card__submit.is-loading .form-card__submit-text {
  display: none;
}

.form-card__submit.is-loading .form-card__spinner {
  display: inline-block;
}

/* ── #11: Success State ── */
.form-card__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.form-card__success.visible {
  opacity: 1;
  transform: translateY(0);
}

.form-card__success-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
}

.form-card__success-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  margin-bottom: 16px;
}

.form-card__success-text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
  max-width: 400px;
  line-height: 1.65;
  margin-bottom: 20px;
}

.form-card__success-note {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.5;
}

/* Fade-out for form content */
#form-content {
  transition: opacity 300ms ease;
}

#form-content.fading {
  opacity: 0;
}

/* ════════════════════════════════════════════════════════════════
   #19: FOOTER
   ════════════════════════════════════════════════════════════════ */
.footer {
  padding: 48px 24px 64px;
  background: var(--bg);
}

.footer__inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer__logo {
  width: 32px;
  height: 32px;
  opacity: 0.5;
}

.footer__wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  opacity: 0.6;
}

.footer__note {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.55;
  max-width: 460px;
  line-height: 1.6;
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════════
   #16: RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .form-section {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .top-bar__inner {
    padding: 14px 20px;
    min-height: 56px;
  }

  .top-bar__wordmark {
    font-size: 1.15rem;
  }

  .hero__heading {
    font-size: clamp(32px, 8vw, 48px);
  }

  .steps__row {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .steps__card {
    max-width: 100%;
  }

  .form-card {
    border-radius: 12px;
    padding: 24px 20px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero {
    padding-top: 80px;
  }

  .field-group__label {
    font-size: 12px;
  }

  /* min tap targets */
  .hero__cta,
  .form-card__submit {
    min-height: 48px;
  }

  .field-group__input {
    min-height: 48px;
  }
}