/* ATB Telematics — Full-screen cinematic coming soon */

:root {
  --accent: #f2702a;
  --accent-navy: #0c2d4d;
  --glass: rgba(8, 12, 20, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.78);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Background carousel ---- */
.bg-carousel {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.8s var(--ease), transform 8s linear;
}

.bg-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.65) 100%),
    linear-gradient(105deg, rgba(0, 0, 0, 0.5) 0%, transparent 55%);
  pointer-events: none;
}

/* ---- Page shell (no scroll) ---- */
.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  flex-shrink: 0;
}

.logo__img {
  height: clamp(36px, 5vh, 52px);
  width: auto;
  max-width: min(220px, 45vw);
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s;
}

.icon-btn:hover {
  color: var(--accent);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  box-shadow: 0 4px 20px rgba(242, 112, 42, 0.45);
}

.btn--light {
  background: #fff;
  color: #111;
}

.btn--light:hover {
  box-shadow: 0 6px 28px rgba(255, 255, 255, 0.25);
}

.btn--ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  color: #fff;
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--full {
  width: 100%;
}

.btn__loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Main stage ---- */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  min-height: 0;
}

.stage__glass {
  width: 100%;
  max-width: 720px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.75rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.headline__sub {
  display: block;
  font-size: 0.55em;
  font-weight: 500;
  color: var(--text-soft);
  margin-top: 0.35em;
  letter-spacing: 0.01em;
}

/* ---- Service rotator ---- */
.service-rotator {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  text-align: left;
  min-height: 110px;
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.service-rotator__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.service-rotator__icon svg {
  width: 26px;
  height: 26px;
}

.service-rotator__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.service-rotator__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.service-rotator__desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.service-rotator__text {
  flex: 1;
  min-width: 0;
}

/* Text transition */
.service-rotator.is-animating .service-rotator__title,
.service-rotator.is-animating .service-rotator__desc,
.service-rotator.is-animating .service-rotator__label {
  animation: textOut 0.35s var(--ease) forwards;
}

.service-rotator.is-entering .service-rotator__title,
.service-rotator.is-entering .service-rotator__desc,
.service-rotator.is-entering .service-rotator__label {
  animation: textIn 0.45s var(--ease) forwards;
}

.service-rotator.is-animating .service-rotator__icon {
  animation: iconOut 0.35s var(--ease) forwards;
}

.service-rotator.is-entering .service-rotator__icon {
  animation: iconIn 0.45s var(--ease) forwards;
}

@keyframes textOut {
  to { opacity: 0; transform: translateY(-12px); }
}

@keyframes textIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes iconOut {
  to { opacity: 0; transform: scale(0.85); }
}

@keyframes iconIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Service dots */
.service-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.service-dots__dot {
  width: 28px;
  height: 3px;
  border: none;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, width 0.3s;
}

.service-dots__dot.is-active {
  background: var(--accent);
  width: 40px;
}

.stage__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ---- Bottom bar ---- */
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.bottombar__link {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.bottombar__link:hover {
  color: var(--accent);
}

.bg-indicators {
  display: flex;
  gap: 0.4rem;
}

.bg-indicators__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s, transform 0.3s;
}

.bg-indicators__dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

/* ---- Modal ---- */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  background: rgba(12, 18, 28, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.35s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.modal__sub {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1.25rem;
}

/* ---- Form ---- */
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form__field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.3rem;
}

.form__field input,
.form__field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.form__field input:focus,
.form__field select:focus {
  outline: none;
  border-color: var(--accent);
}

.form__field input.is-invalid {
  border-color: #f87171;
}

.form__interests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form__interests-label {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-right: 0.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  cursor: pointer;
  color: var(--text-soft);
}

.chip:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form__message {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
}

.form__message.is-success { color: #6ee7b7; }
.form__message.is-error { color: #fca5a5; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .topbar__actions .btn--accent {
    display: none;
  }

  .service-rotator {
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 130px;
  }

  .form__grid {
    grid-template-columns: 1fr;
  }

  .bottombar {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    text-align: center;
  }

  .bottombar__copy {
    order: 3;
    width: 100%;
  }

  .bg-indicators {
    order: 1;
  }

  .bottombar__link {
    order: 2;
    font-size: 0.75rem;
  }
}

@media (max-height: 640px) {
  .stage__glass {
    padding: 1rem 1.25rem;
  }

  .headline {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .service-rotator {
    min-height: 90px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .service-dots {
    margin-bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-slide {
    transition: opacity 0.5s ease;
    transform: none !important;
  }

  .service-rotator.is-animating .service-rotator__title,
  .service-rotator.is-animating .service-rotator__desc,
  .service-rotator.is-entering .service-rotator__title,
  .service-rotator.is-entering .service-rotator__desc {
    animation: none;
  }
}
