/*
 * Minimal theme override - softens page background only.
 * Keeps cards, inputs, text, and dark elements untouched
 * to preserve the original design hierarchy.
 */

html, body {
  background-color: #f5f1e8;
}

/* Auth/login page - softer cream */
body.bg-paper,
body[class*="bg-paper"] {
  background-color: #f5f1e8 !important;
}

/* Page-level "surface" backgrounds (rare, behind cards) */
.bg-surface {
  background-color: #ebe6d9;
}

/* Print: keep pure white */
@media print {
  html, body { background-color: #ffffff !important; }
}

.pwa-install-cta {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4.4rem);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #d9d3c6;
  border-radius: 0.9rem;
  background: #fffdf8;
  box-shadow: 0 10px 24px rgba(20, 20, 22, 0.12);
  padding: 0.45rem;
}

.pwa-install-cta[hidden] {
  display: none !important;
}

.pwa-install-btn {
  flex: 1;
  border: 0;
  border-radius: 0.7rem;
  background: #f58220;
  color: #ffffff;
  font-family: Geist, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
}

.pwa-install-btn:hover,
.pwa-install-btn:focus-visible {
  background: #e06f0f;
}

.pwa-install-dismiss {
  border: 1px solid #d9d3c6;
  border-radius: 0.7rem;
  background: #f7f3e9;
  color: #3f4550;
  font-family: Geist, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.68rem 0.75rem;
  cursor: pointer;
}

.pwa-install-dismiss:hover,
.pwa-install-dismiss:focus-visible {
  background: #ece5d5;
}

@media (min-width: 1024px) {
  .pwa-install-cta {
    left: auto;
    right: 1.25rem;
    width: 20rem;
    bottom: 1.25rem;
  }
}

/* =========================================================
 * Mobile navigation drawer
 * Direct child of <body>; fixed to viewport so it overlays
 * reliably regardless of page wrapper / transforms.
 * ========================================================= */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: hsla(0, 0%, 5%, 0.7);
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100%;
  max-height: 100%;
}

@media (min-width: 1024px) {
  .mobile-drawer,
  .mobile-drawer.is-open {
    display: none !important;
  }
}

/* =========================================================
 * Driver onboarding wizard
 * ========================================================= */
.onboarding-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 1.6rem 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, #f58220 0%, #e06f0f 55%, #c85f08 100%);
  box-shadow: 0 18px 40px rgba(224, 111, 15, 0.28);
}

.onboarding-hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.onboarding-eyebrow {
  display: inline-block;
  font-family: Geist, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.onboarding-title {
  margin-top: 0.35rem;
  font-family: Geist, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
}

.onboarding-text {
  margin-top: 0.5rem;
  max-width: 34rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.onboarding-progress {
  position: relative;
  margin-top: 1.1rem;
}

.onboarding-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: Geist, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.onboarding-progress-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.5s ease;
}

/* Stepper */
.step-track {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .step-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #e4ddcd;
  border-radius: 0.95rem;
  background: #fffdf8;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.step-item .step-dot {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-family: Geist, sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
}

.step-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.step-label {
  font-family: Geist, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2329;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-state {
  font-size: 0.74rem;
  font-weight: 600;
  color: #8a8575;
}

/* states */
.step-item.is-todo .step-dot {
  background: #f0ebdd;
  color: #9a9484;
}

.step-item.is-current {
  border-color: #f58220;
  box-shadow: 0 8px 20px rgba(245, 130, 32, 0.18);
  transform: translateY(-1px);
}

.step-item.is-current .step-dot {
  background: #f58220;
  color: #fff;
}

.step-item.is-current .step-state {
  color: #e06f0f;
}

.step-item.is-done .step-dot {
  background: #e7f6ec;
  color: #1c8a4d;
}

.step-item.is-done .step-state {
  color: #1c8a4d;
}

/* Current-step form header */
.step-current-head {
  border-bottom: 1px solid #ece6d8;
  padding-bottom: 0.85rem;
}

.step-current-badge {
  display: inline-block;
  font-family: Geist, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e06f0f;
  background: #fdf0e2;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

.step-current-title {
  margin-top: 0.5rem;
  font-family: Geist, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1f2329;
}

.step-current-sub {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #6c6757;
}

/* Completion card */
.onboarding-done {
  text-align: center;
}

.onboarding-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: #e7f6ec;
  color: #1c8a4d;
  margin: 0 auto;
}

.onboarding-pending-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: #fdf0e2;
  color: #e06f0f;
  margin: 0 auto;
}

.onboarding-done-title {
  margin-top: 0.75rem;
  font-family: Geist, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #1f2329;
}

.onboarding-done-text {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #6c6757;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
 * Account page
 * ========================================================= */
.account-hero {
  border: 1px solid #e9e0cf;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(245, 130, 32, 0.14) 0%, rgba(245, 130, 32, 0) 52%),
    #fffdf8;
}

.account-hero-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.2rem;
}

.account-card {
  border: 1px solid #ece4d5;
  background: #fff;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.account-read-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.account-read-grid > div {
  border: 1px solid #eee7da;
  border-radius: 0.85rem;
  background: #fffdf8;
  padding: 0.62rem 0.75rem;
}

.account-read-grid span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8575;
}

.account-read-grid strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #1f2329;
  word-break: break-word;
}

.account-edit-form {
  border-top: 1px solid #ede6d8;
  padding-top: 0.9rem;
}

@media (min-width: 640px) {
  .account-read-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
 * Driver expenses page
 * ========================================================= */
.expense-page .expense-stat {
  border: 1px solid #ece4d5;
  background: #fff;
}

.expense-page .expense-form-card {
  border: 1px solid #ece4d5;
  background: #fff;
}

.expense-dropzone {
  border: 2px dashed #e7decc;
  border-radius: 1rem;
  background: #faf7ef;
  text-align: center;
  padding: 1.1rem 1rem 1rem;
}

.expense-dropzone:hover {
  border-color: #e3c8a6;
}
