/* =========================================================
   P2A – BASE STYLES (selected parts: 1,2,3,4,5,6,7,8,10,15)
   ====================================================== */

/* 1. GLOBAL RESET */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
}

/* Shared loading treatment: keep slow actions visually consistent. */
.p2a-loading-gif {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  vertical-align: middle;
  pointer-events: none;
  user-select: none;
}

.p2a-loading-gif--lg {
  width: 3rem;
  height: 3rem;
}

.p2a-button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  line-height: 1.1;
}

button[aria-busy="true"],
a[aria-busy="true"] {
  cursor: wait !important;
}

/* 2. UTILITIES – FADE MASK */
@layer utilities {
  .fade-mask {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: fadeMaskIn 1.5s ease-out forwards;
  }
}

/* 3. DESKTOP FADE-MASK SHAPE */
@media (min-width: 640px) {
  .fade-mask {
    -webkit-mask-image: linear-gradient(
      to right,
      rgba(0,0,0,0.00) 0%,
      rgba(0,0,0,0.30) 10%,
      rgba(0,0,0,0.70) 20%,
      rgba(0,0,0,1.00) 50%,
      rgba(0,0,0,1.00) 60%,
      rgba(0,0,0,0.70) 80%,
      rgba(0,0,0,0.30) 90%,
      rgba(0,0,0,0.00) 100%
    );
    mask-image: linear-gradient(
      to right,
      rgba(0,0,0,0.00) 0%,
      rgba(0,0,0,0.75) 20%,
      rgba(0,0,0,1.00) 50%,
      rgba(0,0,0,1.00) 60%,
      rgba(0,0,0,0.75) 80%,
      rgba(0,0,0,0.30) 90%,
      rgba(0,0,0,0.00) 100%
    );
  }
}

/* 4. MOBILE FADE-MASK SHAPE */
@media (max-width: 639px) {
  .fade-mask {
    -webkit-mask-image: linear-gradient(
      to right,
      rgba(0,0,0,0.00) 0%,
      rgba(0,0,0,0.25) 5%,
      rgba(0,0,0,0.50) 10%,
      rgba(0,0,0,0.80) 15%,
      rgba(0,0,0,0.99) 50%,
      rgba(0,0,0,0.99) 60%,
      rgba(0,0,0,0.80) 85%,
      rgba(0,0,0,0.50) 90%,
      rgba(0,0,0,0.25) 95%,
      rgba(0,0,0,0.00) 100%
    );
    mask-image: linear-gradient(
      to right,
      rgba(0,0,0,0.00) 0%,
      rgba(0,0,0,0.25) 5%,
      rgba(0,0,0,0.50) 10%,
      rgba(0,0,0,0.80) 15%,
      rgba(0,0,0,0.99) 50%,
      rgba(0,0,0,0.99) 60%,
      rgba(0,0,0,0.80) 85%,
      rgba(0,0,0,0.50) 90%,
      rgba(0,0,0,0.25) 95%,
      rgba(0,0,0,0.00) 100%
    );
  }
}

/* 5. FADE-MASK KEYFRAMES */
@keyframes fadeMaskIn {
  0% {
    -webkit-mask-position: left;
    mask-position: left;
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* 6. LOGO SHINE KEYFRAMES */
@keyframes logo-shine {
  0%   { background-position-x: 150%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { background-position-x: -150%; opacity: 0; }
}

/* 7. LOGO CONTAINER + SHINE MASK */
.logo-container {
  position: relative;
  overflow: hidden;
  display: inline-block;
  isolation: isolate;
  transform: translateZ(0);
}

.shine-mask {
  background: linear-gradient(
    330deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.logo-container:hover .shine-mask,
.logo-container.animate-shine .shine-mask {
  animation: logo-shine 0.8s ease-out;
}

/* 8. BRAND TEXT (Plymouth To Airport) */
.brand--coloured,
.brand--coloured-local {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.28em;
}

.brand--coloured .w-plymouth {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(90deg, #ff4242 0%, #ff5858 45%, #ff787a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.brand--coloured .w-to {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  color: #ecf0f1;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.brand--coloured .w-airport {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(90deg, #7bb0ff 0%, #6ea8ff 45%, #2e8cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* 9. BRAND TEXT (Plymouth Local Taxi) */
.brand--coloured-local .w-plymouth {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(90deg, #7bb0ff 0%, #6ea8ff 45%, #2e8cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.brand--coloured-local .w-local {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.brand--coloured-local .w-taxi {
  display: inline-block;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(90deg, #ffe066 0%, #ffd43b 45%, #f4b400 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* 9. GOOGLE PLACES STACKING */
.pac-container {
  z-index: 300 !important;
}

html.p2a-modal-open .pac-container,
body.p2a-modal-open .pac-container {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* 10. PASSENGER SERVICE SWITCH
   Keeps the dark-glass driver character while giving each service its own
   established palette: yellow/fuchsia for Local, red/blue for Airport. */
.service-mode-switch {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.42fr);
  width: min(36rem, calc(100% - 1.5rem));
  margin: -0.2rem auto 0.7rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  background: rgba(3, 7, 18, 0.78);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  max-height: 4rem;
  overflow: hidden;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    max-height 220ms ease,
    margin-bottom 220ms ease,
    padding-top 220ms ease,
    padding-bottom 220ms ease,
    border-width 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms step-start;
}

/* The booking-mode tab is useful at the start of the page, but should not
   remain over the form while the passenger is scrolling. */
.service-mode-switch.is-scroll-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transform: translateY(-0.75rem) scale(0.98);
  transition:
    max-height 200ms ease,
    margin-bottom 200ms ease,
    padding-top 200ms ease,
    padding-bottom 200ms ease,
    border-width 150ms ease,
    opacity 150ms ease,
    transform 150ms ease,
    visibility 0s linear 150ms;
}

.service-mode-option {
  display: flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.service-mode-option:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.service-mode-option:active {
  transform: translateY(1px);
}

.service-mode-option:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.service-mode-switch--local .service-mode-option.is-active {
  border-color: rgba(253, 224, 71, 0.72);
  background: linear-gradient(135deg, #fde047 0%, #facc15 35%, #d946ef 100%);
  box-shadow:
    0 8px 22px rgba(217, 70, 239, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #18111f;
}

.service-mode-switch--airport .service-mode-option.is-active {
  border-color: rgba(96, 165, 250, 0.7);
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 38%, #2563eb 100%);
  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

@media (min-width: 640px) {
  .service-mode-option {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-mode-switch,
  .service-mode-option {
    transition: none;
  }
}

/* 11. GLASS PANELS (cookie, generic) */
.glass-panel,
#cookie-banner {
  box-shadow:
    0 30px 80px rgba(0,0,0,0.9),
    0 0 60px rgba(0,0,0,0.9);
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 1.5rem;
  isolation: isolate;
  contain: paint;
  transform: translateZ(0);
}
