/* ==========================================================================
   EZ Rentals — Customer Self-Service App
   Light theme: white background, black text & buttons.
   Prototype for manager review. No backend/API keys required.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #0a0a0a;
  --ink-2: #444444;
  --ink-3: #767680;
  --line: #e2e2e6;
  --line-strong: #111111;
  --accent: #0a0a0a;
  --danger: #c0261c;
  --ok: #0a7d33;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --maxw: 560px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* -------------------------------------------------------------------------- */
/* Layout shell                                                               */
/* -------------------------------------------------------------------------- */

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

@media (max-width: 600px) {
  .app { border-left: 0; border-right: 0; }
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 12px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
}

.step-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Progress bar */
.progress {
  margin-top: 12px;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Main scroll area */
.main {
  flex: 1;
  padding: 22px 20px 20px;
  overflow-y: auto;
}

/* Footer nav */
.footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  gap: 12px;
}

/* -------------------------------------------------------------------------- */
/* Steps                                                                      */
/* -------------------------------------------------------------------------- */

.step { display: none; animation: fade 0.3s ease; }
.step.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 6px;
}
.step-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  line-height: 1.15;
}
.step-sub {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 22px;
  line-height: 1.45;
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 460px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

label.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.req { color: var(--danger); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23767680' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}
textarea { resize: vertical; min-height: 84px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

input.err, select.err, textarea.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(192, 38, 28, 0.1);
}

.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field-err.show { display: block; }

/* Checkbox row */
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.check:hover { border-color: var(--ink-3); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: 0 0 auto; }
.check span { font-size: 14px; color: var(--ink); line-height: 1.4; }
.check.on { border-color: var(--line-strong); background: var(--surface-2); }

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.btn {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius);
  padding: 15px 20px;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: transform 0.06s ease, opacity 0.2s, background 0.15s;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--ink); color: #fff; flex: 1; }
.btn-primary:hover:not(:disabled) { background: #262626; }

.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

.btn-block { width: 100%; }
.btn-back { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }

/* -------------------------------------------------------------------------- */
/* Vehicle cards                                                              */
/* -------------------------------------------------------------------------- */

.veh-list { display: flex; flex-direction: column; gap: 12px; }

.veh {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.veh:hover { border-color: var(--ink-3); }
.veh.on { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.07); }

.veh-thumb {
  width: 78px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 30px;
}
.veh-body { flex: 1; min-width: 0; }
.veh-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.veh-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.veh-price { text-align: right; flex: 0 0 auto; }
.veh-price b { font-size: 17px; font-weight: 800; }
.veh-price small { display: block; font-size: 11px; color: var(--ink-3); }

.veh-radio {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center;
}
.veh.on .veh-radio { border-color: var(--ink); }
.veh.on .veh-radio::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Uploads                                                                    */
/* -------------------------------------------------------------------------- */

.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.upload {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 14px;
  cursor: pointer;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.15s;
}
.upload.optional { border-style: dashed; border-color: var(--line); }
.upload:hover { border-color: var(--ink); }
.upload input[type="file"] { display: none; }
.upload-ico { font-size: 26px; }
.upload-label { font-size: 13px; font-weight: 700; }
.upload-sub { font-size: 11px; color: var(--ink-3); }
.upload .badge-req {
  font-size: 10px; font-weight: 800; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 6px; padding: 1px 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.upload img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.upload .done-check {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.upload.full { grid-column: 1 / -1; min-height: 110px; }

/* -------------------------------------------------------------------------- */
/* Terms accordion                                                            */
/* -------------------------------------------------------------------------- */

.terms {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 4px;
  background: var(--surface);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.term {
  border-bottom: 1px solid var(--line);
}
.term:last-child { border-bottom: 0; }
.term-head {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 14px 12px; font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.term-head .chev { transition: transform 0.2s; color: var(--ink-3); flex: 0 0 auto; }
.term.open .term-head .chev { transform: rotate(180deg); }
.term-body {
  display: none; padding: 0 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.55;
}
.term.open .term-body { display: block; }
.term-body p { margin: 0 0 9px; }
.term-body ul { margin: 0 0 9px; padding-left: 18px; }

/* -------------------------------------------------------------------------- */
/* Signature                                                                  */
/* -------------------------------------------------------------------------- */

.sig-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
#sigCanvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.sig-baseline {
  position: absolute; left: 18px; right: 18px; bottom: 34px; border-bottom: 1px dashed var(--ink-3);
  pointer-events: none;
}
.sig-x { position: absolute; left: 18px; bottom: 16px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.sig-clear {
  position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: 700;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* Summary / review                                                           */
/* -------------------------------------------------------------------------- */

.summary { display: flex; flex-direction: column; gap: 14px; }
.sum-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.sum-card h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); margin: 0 0 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.sum-card h3 .edit {
  font-size: 12px; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0;
  cursor: pointer; text-decoration: underline; background: none; border: 0; padding: 0;
}
.sum-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 14px; }
.sum-row .k { color: var(--ink-3); flex: 0 0 auto; }
.sum-row .v { color: var(--ink); text-align: right; font-weight: 600; word-break: break-word; }

.cost-box {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-2);
}
.cost-row { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; }
.cost-row.total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }

/* -------------------------------------------------------------------------- */
/* Welcome + hero                                                             */
/* -------------------------------------------------------------------------- */

.hero { text-align: center; padding: 24px 0 10px; }
.hero-mark {
  width: 64px; height: 64px; border-radius: 18px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 0 auto 20px;
}
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 10px; line-height: 1.1; }
.hero p { font-size: 15.5px; color: var(--ink-2); margin: 0 0 26px; line-height: 1.5; }

.steps-preview { display: flex; flex-direction: column; gap: 2px; text-align: left; margin: 0 0 8px; }
.sp-item { display: flex; align-items: center; gap: 13px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.sp-item:last-child { border-bottom: 0; }
.sp-num {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.sp-txt b { display: block; font-size: 14.5px; font-weight: 700; }
.sp-txt small { font-size: 12.5px; color: var(--ink-3); }

/* -------------------------------------------------------------------------- */
/* Verification call + success                                                */
/* -------------------------------------------------------------------------- */

.center-stage { text-align: center; padding: 20px 0; }
.big-ico {
  width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 22px;
  background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 40px;
}
.big-ico.solid { background: var(--ink); color: #fff; border-color: var(--ink); }

.ref-chip {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px; font-weight: 700; letter-spacing: 0.05em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; margin: 4px 0 22px;
}

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--ink);
  border-radius: var(--radius-sm); padding: 13px 15px; background: var(--surface-2);
  font-size: 13.5px; color: var(--ink-2); line-height: 1.5; text-align: left; margin: 18px 0;
}
.callout b { color: var(--ink); }

.tag-note {
  font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 14px; line-height: 1.5;
}

/* Section divider inside a step */
.sec {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.sec:first-child { margin-top: 4px; }

/* Additional drivers */
.driver-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px;
}
.driver-row .rm {
  width: 40px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font-size: 18px; color: var(--danger);
}
.add-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
  color: var(--ink); cursor: pointer; background: none; border: 0; padding: 6px 0; text-decoration: underline;
}

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 50; max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
