:root {
  font-family: Inter, Arial, sans-serif;
  color: #17202a;
  background: #f4f6f8;

  --aaa-navy: #061a3a;
  --aaa-navy-dark: #031128;
  --aaa-gold: #f4b400;
  --aaa-gold-light: #ffd45c;
  --aaa-green: #0fa34a;
  --aaa-green-dark: #087d37;
  --aaa-red: #b91c1c;
  --aaa-white: #ffffff;
  --aaa-border: #e3e8ef;
  --aaa-muted: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
}

/* =========================================================
   SHARED DISPATCHER / DRIVER STYLES
   ========================================================= */

header {
  background: #111827;
  color: white;
  padding: 18px 20px;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
}

main {
  max-width: 820px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-family: inherit;
  font-size: 16px;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 13px 16px;
  background: #0f766e;
  color: white;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin-top: 12px;
}

button:hover,
.button:hover {
  filter: brightness(0.94);
}

button.secondary,
.button.secondary {
  background: #334155;
}

button.danger,
.button.danger,
.danger-button {
  background: #b91c1c;
  color: white;
}

button.danger:hover,
.button.danger:hover,
.danger-button:hover {
  background: #991b1b;
}

button:disabled,
.button:disabled,
.danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.notice {
  border-left: 5px solid #0f766e;
  background: #ecfdf5;
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.error {
  border-left-color: #b91c1c;
  background: #fef2f2;
}

.muted {
  color: #64748b;
  font-size: 0.93rem;
}

.code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 8px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#map {
  height: 390px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}

.status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.button-row button,
.button-row .button {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   CUSTOMER PAGE
   ========================================================= */

body.customer-page {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top,
      rgba(244, 180, 0, 0.08),
      transparent 28%
    ),
    #f5f7fa;
  color: var(--aaa-navy);
}

/* Customer branded header */

.customer-page .customer-header {
  position: relative;
  min-height: 190px;
  padding:
    max(22px, env(safe-area-inset-top))
    22px
    54px;
  overflow: visible;
  background:
    radial-gradient(
      circle at 75% 30%,
      rgba(40, 92, 160, 0.35),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #031128 0%,
      #061a3a 55%,
      #0a2b57 100%
    );
  color: white;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.customer-header-inner {
  width: min(100%, 760px);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.customer-brand {
  min-width: 0;
}

.customer-brand-name {
  color: white;
  font-size: clamp(2.3rem, 9vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 950;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.28);
}

.customer-brand-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--aaa-gold);
  font-size: clamp(1rem, 4vw, 1.55rem);
  font-weight: 950;
  letter-spacing: 0.08em;
}

.customer-brand-subtitle span {
  display: block;
  width: clamp(30px, 8vw, 58px);
  height: 7px;
  background:
    linear-gradient(
      to bottom,
      var(--aaa-gold) 0 38%,
      transparent 38% 55%,
      var(--aaa-gold) 55% 100%
    );
  clip-path: polygon(0 20%, 100% 0, 78% 100%, 0 82%);
}

.customer-taxi-illustration {
  flex: 0 0 auto;
  font-size: clamp(4.3rem, 17vw, 8rem);
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
  transform: translateY(8px);
}

/* Customer main container */

.customer-page .customer-main {
  position: relative;
  width: min(100%, 680px);
  max-width: 680px;
  margin: 0 auto;
  padding: 76px 16px 24px;
}

.customer-logo-wrap {
  position: absolute;
  z-index: 1000;
  top: -74px;
  left: 50%;
  width: 148px;
  height: 148px;
  transform: translateX(-50%);
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(
    145deg,
    #ffdf6d,
    #b87a00
  );
  box-shadow:
    0 12px 30px rgba(3, 17, 40, 0.3),
    0 0 0 6px white;
}

.customer-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: #000;
}

.customer-section {
  width: 100%;
  margin-bottom: 16px;
  padding: 22px;
  background: white;
  border: 1px solid rgba(218, 225, 234, 0.9);
  border-radius: 22px;
  box-shadow:
    0 7px 24px rgba(15, 23, 42, 0.08);
}

.customer-intro {
  padding-top: 36px;
  text-align: center;
}

.customer-title {
  margin: 0 auto;
  max-width: 520px;
  color: var(--aaa-navy);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.07;
  letter-spacing: -0.035em;
  font-weight: 950;
}

.customer-subtitle {
  max-width: 520px;
  margin: 14px auto 20px;
  color: #26354d;
  font-size: 1.06rem;
  line-height: 1.58;
}

/* Keep page open warning */

.keep-open-warning {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 18px 0;
  padding: 15px;
  color: #2d2718;
  text-align: left;
  background:
    linear-gradient(
      135deg,
      #fffdf5,
      #fff4cf
    );
  border: 1px solid #f3d885;
  border-radius: 15px;
}

.keep-open-icon {
  flex: 0 0 auto;
  font-size: 1.8rem;
  line-height: 1;
}

.keep-open-warning strong {
  display: block;
  margin-bottom: 4px;
  color: var(--aaa-navy);
  font-size: 1rem;
  font-weight: 900;
}

.keep-open-warning p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Customer location status */

.customer-status {
  text-align: left;
}

.customer-share-button {
  width: 100%;
  min-height: 60px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 13px;
  background:
    linear-gradient(
      135deg,
      #0fb451,
      #07913e
    );
  box-shadow:
    0 8px 20px rgba(15, 163, 74, 0.25);
  font-size: 1.08rem;
}

.customer-share-button:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.customer-stop-button {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  background: var(--aaa-red);
}

/* Security feature row */

.customer-features {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--aaa-border);
}

.customer-feature {
  min-width: 0;
  padding: 18px 12px 4px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}

.customer-feature + .customer-feature {
  border-left: 1px solid var(--aaa-border);
}

.customer-feature-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.customer-feature strong {
  color: var(--aaa-navy);
  font-size: 0.92rem;
  line-height: 1.25;
}

.customer-feature span {
  color: var(--aaa-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Location shared card */

.customer-shared-section {
  padding: 15px;
}

.location-shared-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  color: #105b2c;
  text-align: left;
  background:
    linear-gradient(
      135deg,
      #effdf4,
      #e1f8ea
    );
  border: 1px solid #c7efd5;
  border-radius: 15px;
}

.location-shared-check {
  flex: 0 0 auto;
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--aaa-green);
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 950;
  box-shadow:
    0 5px 13px rgba(15, 163, 74, 0.25);
}

.location-shared-card strong {
  display: block;
  margin-bottom: 4px;
  color: #0d5d2b;
  font-size: 1.1rem;
  font-weight: 900;
}

.location-shared-card p {
  margin: 0;
  color: #346e49;
  font-size: 0.9rem;
}

/* Live tracking */

.tracking-section {
  padding: 16px;
}

.tracking-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tracking-heading h2 {
  margin: 0;
  color: var(--aaa-navy);
  font-size: 1.25rem;
  font-weight: 950;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--aaa-green);
  font-size: 0.91rem;
  font-weight: 850;
}

.live-indicator span {
  width: 9px;
  height: 9px;
  background: var(--aaa-green);
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(15, 163, 74, 0.12);
  animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

.customer-driver-map {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  background: #edf1f5;
  border: 1px solid var(--aaa-border);
  border-radius: 16px;
  z-index: 1;
}

.customer-driver-map .leaflet-control-container,
.customer-driver-map .leaflet-pane {
  z-index: auto;
}

.customer-driver-map .leaflet-control-zoom a {
  color: var(--aaa-navy);
}

.customer-driver-map .leaflet-control-attribution {
  font-size: 9px;
}

/* Custom map markers */

.customer-driver-map-icon,
.customer-location-map-icon {
  background: transparent;
  border: 0;
}

.driver-marker-bubble {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--aaa-gold);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow:
    0 6px 17px rgba(3, 17, 40, 0.35);
  font-size: 1.55rem;
}

.customer-marker-bubble {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--aaa-green);
  border: 4px solid white;
  border-radius: 50% 50% 50% 0;
  box-shadow:
    0 6px 17px rgba(15, 163, 74, 0.35);
  font-size: 0.8rem;
  transform: rotate(-45deg);
}

.customer-marker-bubble::before {
  content: "";
  width: 11px;
  height: 11px;
  background: white;
  border-radius: 50%;
  transform: rotate(45deg);
}

/* Driver information card */

.customer-driver-card {
  position: relative;
  z-index: 500;
  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr)
    auto
    auto;
  align-items: center;
  gap: 11px;
  width: calc(100% - 20px);
  margin: -43px auto 0;
  padding: 13px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--aaa-border);
  border-radius: 16px;
  box-shadow:
    0 9px 25px rgba(15, 23, 42, 0.14);
}

.driver-avatar {
  width: 53px;
  height: 53px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      145deg,
      #e9edf2,
      #cfd6de
    );
  border-radius: 50%;
  font-size: 1.8rem;
}

.driver-information {
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.driver-information span {
  color: var(--aaa-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.driver-information strong {
  overflow: hidden;
  color: var(--aaa-navy);
  font-size: 1.25rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-contact-button {
  min-width: 58px;
  padding: 7px 5px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  color: var(--aaa-navy);
  background: transparent;
  border: 0;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 800;
}

.driver-contact-button span {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid var(--aaa-border);
  border-radius: 50%;
  box-shadow:
    0 4px 10px rgba(15, 23, 42, 0.09);
  font-size: 1.3rem;
}

/* Trip details */

.customer-trip-details {
  margin-top: 16px;
  padding: 4px 16px;
  background: white;
  border: 1px solid var(--aaa-border);
  border-radius: 16px;
}

.trip-detail-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  text-align: left;
}

.trip-detail-row + .trip-detail-row {
  border-top: 1px solid var(--aaa-border);
}

.trip-detail-icon {
  color: var(--aaa-navy);
  font-size: 1.45rem;
}

.trip-detail-row div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trip-detail-row strong {
  color: var(--aaa-navy);
  font-size: 0.9rem;
  font-weight: 900;
}

.trip-detail-row span {
  color: #3f4c61;
  font-size: 0.85rem;
  line-height: 1.4;
}

.keep-open-warning-bottom {
  margin-bottom: 0;
}

/* Completed state */

.customer-completed-section {
  padding: 34px 22px;
  text-align: center;
}

.completed-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--aaa-green);
  border-radius: 50%;
  font-size: 3rem;
  font-weight: 950;
  box-shadow:
    0 12px 25px rgba(15, 163, 74, 0.25);
}

.customer-completed-section h2 {
  margin: 0 0 10px;
  color: var(--aaa-navy);
  font-size: 1.7rem;
  font-weight: 950;
}

.customer-completed-section p {
  margin: 0;
  color: var(--aaa-muted);
  line-height: 1.55;
}

/* Customer footer */

.customer-footer {
  margin-top: 12px;
  padding:
    24px
    18px
    max(24px, env(safe-area-inset-bottom));
  color: white;
  background:
    linear-gradient(
      145deg,
      var(--aaa-navy-dark),
      var(--aaa-navy)
    );
}

.customer-footer-inner {
  width: min(100%, 650px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
}

.customer-help-icon {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  color: var(--aaa-gold);
  border: 2px solid var(--aaa-gold);
  border-radius: 50%;
  font-size: 1.75rem;
}

.customer-help-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.customer-help-text span {
  color: var(--aaa-gold);
  font-size: 0.88rem;
  font-weight: 900;
}

.customer-help-text a {
  color: white;
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  font-weight: 950;
  text-decoration: none;
}

.customer-help-text small {
  color: #d4dae4;
  font-size: 0.76rem;
}

.customer-checker-pattern {
  width: 105px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.customer-checker-pattern span {
  aspect-ratio: 1;
  background: var(--aaa-gold);
}

.customer-checker-pattern span:nth-child(2),
.customer-checker-pattern span:nth-child(4),
.customer-checker-pattern span:nth-child(5),
.customer-checker-pattern span:nth-child(7) {
  background: transparent;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  main:not(.customer-main) {
    margin-top: 14px;
  }

  header:not(.customer-header) {
    padding: 16px;
  }

  header:not(.customer-header) h1 {
    font-size: 1.15rem;
  }

  .card {
    padding: 16px;
  }

  #map {
    height: 320px;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row button,
  .button-row .button {
    width: 100%;
  }

  .customer-page .customer-header {
    min-height: 160px;
    padding-left: 17px;
    padding-right: 17px;
    padding-bottom: 43px;
  }

  .customer-taxi-illustration {
    font-size: 4.3rem;
  }

  .customer-page .customer-main {
    padding-top: 66px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .customer-logo-wrap {
    top: -64px;
    width: 127px;
    height: 127px;
  }

  .customer-section {
    padding: 17px;
    border-radius: 19px;
  }

  .customer-intro {
    padding-top: 32px;
  }

  .customer-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-feature {
    padding-left: 6px;
    padding-right: 6px;
  }

  .customer-feature strong {
    font-size: 0.77rem;
  }

  .customer-feature span {
    font-size: 0.68rem;
  }

  .customer-driver-map {
    height: 315px;
  }

  .customer-driver-card {
    width: calc(100% - 12px);
    grid-template-columns:
      auto
      minmax(0, 1fr)
      auto
      auto;
    gap: 6px;
    padding: 10px;
  }

  .driver-avatar {
    width: 46px;
    height: 46px;
  }

  .driver-contact-button {
    min-width: 46px;
  }

  .driver-contact-button span {
    width: 37px;
    height: 37px;
  }

  .customer-footer-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .customer-checker-pattern {
    display: none;
  }
}

@media (max-width: 420px) {
  .customer-brand-name {
    font-size: 2.45rem;
  }

  .customer-brand-subtitle {
    font-size: 1rem;
  }

  .customer-taxi-illustration {
    font-size: 3.8rem;
  }

  .customer-title {
    font-size: 2rem;
  }

  .customer-features {
    grid-template-columns: 1fr;
    border-top: 0;
  }

  .customer-feature {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    padding: 13px 0;
    text-align: left;
    border-top: 1px solid var(--aaa-border);
  }

  .customer-feature + .customer-feature {
    border-left: 0;
  }

  .customer-feature-icon {
    grid-row: 1 / 3;
    align-self: center;
    text-align: center;
  }

  .customer-driver-card {
    grid-template-columns:
      auto
      minmax(0, 1fr)
      auto;
  }

  .driver-contact-button:last-child {
    display: none;
  }
}