/* Shared site styles — used by inner pages (apply, sell, contact).
   The Razed-E font is intentionally NOT loaded here; it's home-page only. */

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-style: italic;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

/* Nav overlays the top of the page and scrolls away with content */
body > nav {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
}

/* Mobile slide-in menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 100;
  background: #121414;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .25s ease, transform .25s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mobile-menu .close-btn {
  position: absolute; top: 24px; right: 24px;
  background: none; border: 0; color: #e2e2e2; cursor: pointer; padding: 8px;
}
.mobile-menu nav { all: unset; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.mobile-menu nav a {
  font-family: 'Inter', sans-serif; font-style: italic;
  font-size: 22px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #cfc4c5; text-decoration: none; transition: color .2s;
}
.mobile-menu nav a:hover, .mobile-menu nav a:focus { color: #E60023; }
.mobile-menu nav a.cta {
  margin-top: 16px;
  color: #fff;
  padding: 18px 36px;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.15em;
  background: rgba(230, 0, 35, 0.40);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 4px 24px rgba(230, 0, 35, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.mobile-menu nav a.cta:hover {
  background: rgba(230, 0, 35, 0.55);
  border-color: rgba(255, 255, 255, 0.40);
}

/* Glass-effect rectangular CTA button. Used for nav CTA + form submits. */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  padding: 14px 36px;
  border-radius: 4px;
  background: rgba(230, 0, 35, 0.40);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 4px 24px rgba(230, 0, 35, 0.3);
  transition: background .25s, border-color .25s, box-shadow .25s, transform .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.glass-btn:hover {
  background: rgba(230, 0, 35, 0.55);
  border-color: rgba(255, 255, 255, 0.40);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 6px 30px rgba(230, 0, 35, 0.55);
}
.glass-btn:active { transform: translateY(0) scale(0.97); }
@media (max-width: 640px) {
  .glass-btn { font-size: 15px; padding: 12px 22px; letter-spacing: 0.10em; max-width: 100%; }
}

/* Engine start/stop style circular CTA (unused, kept for reference) */
.engine-btn {
  position: relative;
  display: none;
  align-items: center; justify-content: center;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff5a7a 0%, #E60023 55%, #9b0019 100%);
  text-decoration: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  box-shadow:
    0 0 0 3px #0a0c0c,
    0 0 0 6px #2a2a2a,
    0 8px 28px rgba(230, 0, 35, 0.55),
    inset 0 -5px 14px rgba(0, 0, 0, 0.5),
    inset 0 4px 12px rgba(255, 255, 255, 0.22);
  transition: transform .15s ease, box-shadow .3s ease;
}
@media (min-width: 768px) { .engine-btn { display: flex; } }
.engine-btn-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.engine-curved-text {
  fill: rgba(255, 255, 255, 0.92);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.engine-btn-label {
  position: relative;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  z-index: 1;
}
.engine-btn:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 0 3px #0a0c0c,
    0 0 0 6px #E60023,
    0 12px 36px rgba(230, 0, 35, 0.78),
    inset 0 -5px 14px rgba(0, 0, 0, 0.5),
    inset 0 4px 12px rgba(255, 255, 255, 0.3);
}
.engine-btn:active { transform: scale(0.96); }

/* Brand orbit — AUTO FLEX logo in center with 19 brand emblems in a ring */
.brand-orbit {
  position: relative;
  width: min(82vw, 720px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.brand-orbit .center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  filter: drop-shadow(0 0 40px rgba(230, 0, 35, 0.55));
  z-index: 2;
}
.brand-orbit .emblem {
  position: absolute;
  top: 50%; left: 50%;
  width: 9%;
  filter: invert(1) opacity(0.6);
  transition: filter .3s, transform .3s;
  transform: translate(-50%, -50%)
             rotate(calc(var(--a) * 1deg))
             translateY(-44%)
             rotate(calc(var(--a) * -1deg));
}
.brand-orbit .emblem:hover {
  filter: invert(1) opacity(1);
  transform: translate(-50%, -50%)
             rotate(calc(var(--a) * 1deg))
             translateY(-44%)
             rotate(calc(var(--a) * -1deg))
             scale(1.25);
}
/* Optional slow rotation animation for the entire ring */
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* Subtle background variant: orbit sits faintly behind page content */
.orbit-bg {
  position: relative;
  overflow: hidden;
}
.orbit-bg > .orbit-decoration {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.orbit-bg > .orbit-decoration .brand-orbit {
  opacity: 0.10;
  width: min(120vw, 1100px);
}
.orbit-bg > .orbit-content {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .brand-orbit .emblem { transition: none; }
}
.back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 52px; height: 52px; border-radius: 999px;
  background: rgba(230, 0, 35, 0.9); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 40;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s, transform .25s, background .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(230, 0, 35, 0.3);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: #E60023; box-shadow: 0 4px 24px rgba(230, 0, 35, 0.55); }
.back-to-top:active { transform: scale(0.95); }
.back-to-top .material-symbols-outlined { font-size: 28px; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Glass-effect form controls — dark glass.
   !important is needed because Tailwind's @tailwindcss/forms plugin
   sets background-color: #fff with equal specificity but later source order. */
.afg-input,
.afg-select,
.afg-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  padding: 14px 16px;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  font-family: inherit;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.afg-input::placeholder,
.afg-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}
.afg-input:hover,
.afg-select:hover,
.afg-textarea:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
.afg-input:focus,
.afg-select:focus,
.afg-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #E60023 !important;
  box-shadow:
    0 0 0 3px rgba(230, 0, 35, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.afg-textarea { resize: vertical; min-height: 140px; }

/* Native select dropdown options (dark to match the dark glass) */
.afg-select option { background: #121414; color: #ffffff; }

/* AJAX form status (success / error message) */
.form-status {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 15px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
}
.form-status.success,
.form-status.error { display: block; }
.form-status.success {
  background: rgba(42, 138, 60, 0.18);
  border: 1px solid rgba(42, 138, 60, 0.45);
  color: #82e09b;
  box-shadow: 0 0 24px rgba(42, 138, 60, 0.25);
}
.form-status.error {
  background: rgba(230, 0, 35, 0.18);
  border: 1px solid rgba(230, 0, 35, 0.45);
  color: #ff8a9e;
  box-shadow: 0 0 24px rgba(230, 0, 35, 0.25);
}

/* Custom file-input styling — turns the ugly browser default into glass */
input[type="file"].afg-input {
  padding: 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 14px;
  cursor: pointer;
}
input[type="file"].afg-input::file-selector-button {
  margin-right: 16px;
  padding: 14px 20px;
  background: rgba(230, 0, 35, 0.40);
  color: #fff;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px 0 0 3px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
input[type="file"].afg-input::file-selector-button:hover {
  background: rgba(230, 0, 35, 0.60);
}
/* Safari/older Chrome (webkit) fallback */
input[type="file"].afg-input::-webkit-file-upload-button {
  margin-right: 16px;
  padding: 14px 20px;
  background: rgba(230, 0, 35, 0.40);
  color: #fff;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px 0 0 3px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.afg-label {
  display: block;
  font-family: 'RazedE', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfc4c5;
  margin-bottom: 8px;
}

/* Inner-page banner: darkened car-interior photo with a slow zoom (replaced the flying streaks).
   Markup: <picture class="page-hero-bg" style="--focus: X% Y%"> with a -tall (phone) and -wide image. */
.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  opacity: 0.6;
  animation: hero-drift 30s ease-in-out infinite alternate;
  will-change: transform;
}
/* dark top for the nav + headline, red glow and fade to the page colour at the bottom */
.page-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 11, 0.85) 0%, rgba(10, 11, 11, 0.35) 42%, rgba(18, 20, 20, 0.6) 78%, #121414 100%),
    radial-gradient(ellipse at 50% 115%, rgba(230, 0, 35, 0.25), transparent 60%);
}
@keyframes hero-drift {
  from { transform: scale(1.02); }
  to   { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-hero-bg img { animation: none; }
}

/* ---- "Submitted!" screen shown after a form is sent (scripts/form-ajax.js) ---- */
html.afg-done-open { overflow: hidden; }
.afg-done {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8, 9, 9, 0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: afg-done-fade .3s ease both;
}
.afg-done.closing { animation: afg-done-fade .25s ease reverse both; }
.afg-done-card {
  position: relative; z-index: 1; width: 100%; max-width: 460px;
  padding: 40px 32px 30px; border-radius: 16px; text-align: center;
  background: #fff; color: #1d1f20;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: afg-done-pop .55s cubic-bezier(.2, 1.4, .4, 1) .05s both;
}
.afg-done-card::before {  /* racing-red stripe across the top */
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #E60023, #ff4d5e 60%, #E60023);
}
.afg-done-check { width: 92px; height: 92px; margin: 0 auto 18px; display: block; }
.afg-done-check .ring {
  fill: none; stroke: #E60023; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 145; stroke-dashoffset: 145;
  transform: rotate(-90deg); transform-origin: center;
  animation: afg-done-draw .7s ease-out .25s forwards;
}
.afg-done-check .tick {
  fill: none; stroke: #E60023; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: afg-done-draw .4s ease-out .85s forwards;
}
.afg-done-card h2 {
  margin: 0 0 10px; font: italic 800 28px/1.15 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .01em;
  animation: afg-done-rise .5s ease .55s both;
}
.afg-done-text { margin: 0 auto; max-width: 360px; font-size: 16px; line-height: 1.6; color: #45494d; animation: afg-done-rise .5s ease .7s both; }
.afg-done-ref { margin: 14px 0 0; font-size: 13px; color: #8a8f95; animation: afg-done-rise .5s ease .8s both; }
.afg-done-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; animation: afg-done-rise .5s ease .9s both; }
.afg-done-home {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 32px;
  border-radius: 6px; background: #E60023; color: #fff; text-decoration: none;
  font: italic 800 15px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(230, 0, 35, 0.35); transition: background .2s, transform .15s;
}
.afg-done-home:hover { background: #c4001d; transform: translateY(-1px); }
.afg-done-home:focus-visible, .afg-done-close:focus-visible { outline: 2px solid #1d1f20; outline-offset: 3px; }
.afg-done-close { min-height: 40px; padding: 8px 16px; background: none; border: 0; color: #5f6368; font: 600 14px/1 'Inter', sans-serif; cursor: pointer; }
.afg-done-close:hover { color: #1d1f20; }
.afg-done-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.afg-done-confetti i {
  position: absolute; top: -20px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; opacity: 0;
  animation: afg-done-fall var(--dur) cubic-bezier(.25, .6, .4, 1) var(--delay) forwards;
}
@keyframes afg-done-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes afg-done-pop { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes afg-done-draw { to { stroke-dashoffset: 0; } }
@keyframes afg-done-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes afg-done-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin)); }
}
@media (prefers-reduced-motion: reduce) {
  .afg-done, .afg-done-card, .afg-done-card h2, .afg-done-text, .afg-done-ref, .afg-done-actions { animation: none; }
  .afg-done-check .ring, .afg-done-check .tick { animation: none; stroke-dashoffset: 0; }
  .afg-done-confetti { display: none; }
}
