/* =====================================================================
   FOLD – Forms, steppers, cards, and buttons (driver/laundry apply)
   This file assumes fold.css is already loaded (global colors + header).
   ===================================================================== */

/* ---------- Theme tokens (safe defaults if fold.css not present) ---- */
:root{
  --fold-bg: #f6fbff;
  --fold-text: #223140;
  --fold-muted: #5d7897;
  --fold-blue: #2C7DB5;
  --fold-blue-2: #46a4f7;
  --fold-blue-3: #1b5fa1;
  --fold-green: #2ecc71;
  --fold-red: #d32f2f;
  --fold-card: #ffffff;
  --fold-ring: rgba(70,164,247,.55);
  --fold-shadow-1: 0 6px 22px rgba(151, 199, 255, .26);
  --fold-shadow-2: 0 16px 54px rgba(190, 220, 255, .26), 0 2px 28px rgba(147, 200, 250, .15);
  --fold-radius-lg: 28px;
  --fold-radius-md: 16px;
  --fold-radius-sm: 12px;
}

/* ----------------------------- Shell / header row ------------------- */
.fold-shell{
  max-width: 1100px;
  margin: 36px auto 48px auto;
  padding: 0 18px;
}

.fold-title{
  font-size: clamp(1.75rem, 2.2vw + 1rem, 2.25rem);
  font-weight: 900;
  color: #1a3760;
  letter-spacing: -0.7px;
  margin: 0;
}

.fold-sub{
  margin: 10px 0 18px 0;
  color: #45617c;
  font-weight: 600;
  line-height: 1.45;
}

/* small pill next to the H1 */
.fold-badge{
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  font-size: .90rem;
  font-weight: 800;
  color: var(--fold-blue);
  background: #ecf6ff;
  border: 1px solid #cfe7ff;
  border-radius: 999px;
}

/* toolbar that holds Save / Cancel */
.fold-toolbar{
  margin-left: auto;
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* -------------------------------- Buttons --------------------------- */
.fold-btn{
  appearance: none;
  border: none;
  cursor: pointer;
  user-select: none;
  font: inherit;
  font-weight: 800;
  color: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  line-height: 1;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease, color .16s ease, border-color .16s ease;
  box-shadow: 0 4px 18px rgba(173, 210, 255, .22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* primary action */
.fold-btn--primary{
  background: linear-gradient(90deg, var(--fold-blue), var(--fold-blue-2) 90%);
}
.fold-btn--primary:hover{
  background: var(--fold-blue);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(151,199,255,.34);
}

/* "Save progress" */
.fold-btn--save{
  background: linear-gradient(90deg, #1890ff, var(--fold-blue-2) 90%);
}
.fold-btn--save:hover{
  background: #1890ff;
  transform: translateY(-2px);
}

/* ghost / secondary link button */
.fold-btn--ghost{
  background: transparent;
  color: var(--fold-blue);
  border: 2px solid #d9ecff;
  box-shadow: none;
}
.fold-btn--ghost:hover{
  background: #eaf3fc;
  color: var(--fold-blue-3);
  transform: translateY(-1px);
}

/* disabled state */
.fold-btn[disabled], .fold-btn.is-disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ------------------------------ Cards -------------------------------- */
.fold-card{
  background: var(--fold-card);
  border-radius: var(--fold-radius-lg);
  box-shadow: var(--fold-shadow-2);
  padding: clamp(18px, 2.2vw + 8px, 32px);
  margin-top: 16px;
  position: relative;
}

/* ------------------------------ Stepper ------------------------------ */
.fold-steps{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 16px 0;
}

.fold-step-pill{
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .95rem;
  color: #2a4a66;
  background: linear-gradient(120deg, #fafdff 70%, #eef6ff 100%);
  border: 1px solid #d7e9ff;
  box-shadow: 0 2px 10px rgba(160, 205, 255, .18) inset;
  transition: background .18s ease, color .18s ease, transform .14s ease, border-color .18s ease;
}
.fold-step-pill:hover{ transform: translateY(-1px); }
.fold-step-pill.is-active{
  color: #fff;
  background: linear-gradient(90deg, var(--fold-blue), var(--fold-blue-2) 90%);
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(130, 190, 255, .45);
}

/* allow a future completed state if you add it */
.fold-step-pill.is-complete{
  color: var(--fold-blue);
  background: #e7f3ff;
  border-color: #c7e3ff;
}

/* ---------------------------- Step Panels ---------------------------- */
.step-panel{ display: none; }
.step-panel.is-visible{
  display: block;
  animation: foldPanelIn .24s ease both;
}
@keyframes foldPanelIn{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: none; }
}

/* ------------------------------ Form grid ---------------------------- */
.fold-form{
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px 22px;
}

@media (max-width: 820px){
  .fold-form{ grid-template-columns: 1fr; }
}

/* field + label */
.fold-field{ display: flex; flex-direction: column; }

.fold-label{
  font-weight: 800;
  color: #1e3552;
  margin: 2px 0 8px 2px;
  letter-spacing: -.2px;
}

/* hint text under inputs */
.fold-hint{
  font-size: .95rem;
  color: #5176b1;
  margin-top: 7px;
}

/* inputs */
.fold-input,
.fold-select,
.fold-textarea{
  width: 100%;
  font: inherit;
  color: var(--fold-text);
  background: #fff;
  border: 1.6px solid #d2e5fc;
  border-radius: 13px;
  padding: 13px 14px;
  line-height: 1.25;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .06s ease;
  box-shadow: 0 2px 10px rgba(188, 224, 255, .18);
}

.fold-textarea{
  resize: vertical;
  min-height: 120px;
}

/* focus ring */
.fold-input:focus,
.fold-select:focus,
.fold-textarea:focus{
  border-color: var(--fold-blue-2);
  box-shadow: 0 0 0 3px var(--fold-ring), 0 2px 12px rgba(147, 200, 250, .25);
}

/* placeholder */
.fold-input::placeholder,
.fold-textarea::placeholder{
  color: #8aa6bf;
}

/* select */
.fold-select{
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fold-blue) 50%),
    linear-gradient(135deg, var(--fold-blue) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* checkbox labels inside grid */
.fold-field > label > input[type="checkbox"]{
  accent-color: var(--fold-blue);
  margin-right: 8px;
  transform: translateY(1px);
}

/* invalid state (optionally add .is-invalid via JS/server) */
.is-invalid .fold-input,
.is-invalid .fold-select,
.is-invalid .fold-textarea{
  border-color: var(--fold-red);
  box-shadow: 0 0 0 3px rgba(211,47,47,.12);
}

/* -------------------------------- Callouts --------------------------- */
.fold-callout{
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  margin-top: 14px;
  border: 1px solid #dfeaf6;
  background: #f6fbff;
  color: #31506b;
}
.fold-callout--ok{
  border-color: #bfead1;
  background: #ecf9f1;
  color: #1d7a4f;
}
.fold-callout--err{
  border-color: #f5c9c9;
  background: #fff3f3;
  color: #b71c1c;
}

/* ------------------------------ Bottom nav -------------------------- */
.fold-nav{
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #edf4fb;
  padding-top: 16px;
}
.fold-nav__left,
.fold-nav__right{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Keep the Back button hidden on step 1 (JS toggles visibility) */
#laundryPrev, #driverPrev{ visibility: hidden; }

/* --------------------------- Micro-interactions --------------------- */
.fold-input:hover,
.fold-select:hover,
.fold-textarea:hover{ transform: translateY(-1px); }

.fold-input:active,
.fold-select:active,
.fold-textarea:active{ transform: none; }

/* Prefill date input consistency */
.fold-input[type="date"]{
  color-scheme: light;
}

/* ----------------------------- Utilities ---------------------------- */
.u-full{ width: 100%; }
.u-center{ text-align: center; }

/* -------------------------- Print clean-up -------------------------- */
@media print{
  .fold-toolbar, .fold-steps, .fold-nav{ display: none !important; }
  .fold-card{ box-shadow: none; border: 1px solid #e8eef6; }
}
/* --- Reset any validation background icons that cause the "!!!!!" row --- */
.fold-input,
.fold-select,
.fold-textarea {
  background-color: #fff;
  background-image: none !important;   /* kill any injected background icons */
  background-repeat: no-repeat;         /* safety */
  background-position: 14px center;     /* safety */
  background-size: 18px 18px;           /* safety */
}

/* Keep native validation outline if you want, but without icons */
.fold-input:invalid,
.fold-select:invalid,
.fold-textarea:invalid {
  background-image: none !important;
  /* optional subtle inner outline instead of the browser’s */
  box-shadow: inset 0 0 0 2px rgba(44,125,181,.12);
}

/* Some Chromium builds add a red shadow—remove it for consistency */
.fold-input:invalid:focus,
.fold-select:invalid:focus,
.fold-textarea:invalid:focus {
  box-shadow: inset 0 0 0 2px rgba(44,125,181,.18), 0 0 0 2px rgba(44,125,181,.12);
}
