/* Polk County Golf Carts — rental flow styles.
   Inherits the shared design tokens from /assets/site.css so the
   palette, fonts, and primitives stay consistent. Everything here
   is scoped to the rental experience. */

.rental-body { background: var(--bg); }

/* Progress dots */
.rental-progress {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: .75rem 1rem;
}
.rental-progress ol {
  display: flex; justify-content: center; align-items: center;
  gap: .35rem; max-width: 720px; margin: 0 auto;
  list-style: none; padding: 0;
  font-size: .82rem; color: var(--ink-soft);
}
.rental-progress li {
  display: flex; align-items: center; gap: .45rem;
  flex: 0 0 auto;
}
.rental-progress li::after {
  content: "";
  width: 1.5rem; height: 2px;
  background: var(--line);
  margin: 0 .15rem;
}
.rental-progress li:last-child::after { display: none; }
.rental-progress li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-weight: 700; font-size: .82rem;
  flex-shrink: 0;
}
.rental-progress li.active { color: var(--ink); font-weight: 600; }
.rental-progress li.active span { background: var(--coral); color: #fff; }
.rental-progress li.done span { background: var(--teal-dk); color: #fff; }
.rental-progress li.done::after { background: var(--teal); }

@media (max-width: 520px) {
  .rental-progress ol { font-size: .72rem; gap: .15rem; }
  .rental-progress li::after { width: .9rem; }
  .rental-progress li span { width: 22px; height: 22px; font-size: .75rem; }
}

.rental { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 6rem; }

/* Card containers used by steps 1, 3, 4, 5 */
.rental-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.rental-card.center { text-align: center; }
.rental-card h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: .25rem 0 .35rem; }

.rental-back {
  background: transparent; border: none;
  color: var(--teal-dk); font: 600 .9rem inherit;
  padding: 0 0 1rem; margin-left: -.25rem;
  cursor: pointer;
}
.rental-back:hover { text-decoration: underline; }

.rental-step-head {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.rental-step-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: .25rem 0 .35rem; }

/* Fields */
.rental-field { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; }
.rental-field > span {
  font: 600 .9rem inherit; color: var(--ink);
}
.rental-field em { font-style: normal; color: var(--ink-soft); font-weight: 400; }
.rental-field input,
.rental-field textarea,
.rental-field select {
  font: 16px/1.4 inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .75rem .85rem;
  background: var(--bg);
  width: 100%;
}
.rental-field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%231f5a68' d='M0 0h12L6 8z'/></svg>"); background-repeat: no-repeat; background-position: right .95rem center; background-size: 10px 7px; padding-right: 2.2rem; }
.rental-field input:focus,
.rental-field textarea:focus,
.rental-field select:focus {
  outline: none; border-color: var(--coral); background: #fff;
}
.rental-grid-2 {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 520px) { .rental-grid-2 { grid-template-columns: 1fr; } }

.rental-grid-3 {
  display: grid; gap: 1rem;
  grid-template-columns: 2fr 1fr 1fr;
}
@media (max-width: 520px) { .rental-grid-3 { grid-template-columns: 1fr; } }

/* Shareable social card on Step 5 — full-bleed image preview above
   three platform-branded buttons (Facebook / Instagram / Nextdoor).
   The visual weight is on the image; buttons are supporting actors. */
.share-card {
  margin-top: 2rem;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(20,50,58,.1);
}
.share-header {
  padding: 1.5rem 1.75rem 0;
  text-align: center;
}
.share-header h2 {
  margin: 0 0 .35rem;
  color: var(--teal-dk);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}
.share-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
}
.share-preview {
  padding: 1.25rem 1.75rem 0;
  display: flex; justify-content: center;
  min-height: 120px;
  position: relative;
}
.share-preview img {
  max-width: 100%;
  max-height: 520px;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(20,50,58,.22);
  background: #f4f0e8;
  display: block;
}
.share-loading {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--ink-soft); font-size: .9rem;
}

/* Platform-branded share buttons. Each uses its brand color as the
   background; hover slightly darkens; icons come from the inline
   SVG in the markup. Layout: horizontal on desktop, stacked on
   narrow phones. */
.share-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  padding: 1.25rem 1.75rem 1.75rem;
}
@media (max-width: 520px) {
  .share-actions { grid-template-columns: 1fr; }
}
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .55rem;
  padding: .85rem 1rem;
  border: none;
  border-radius: 10px;
  color: #fff;
  font: 600 .98rem inherit;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.share-btn:hover  { filter: brightness(0.94); transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }
.share-fb  { background: #1877f2; }
.share-ig  { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.share-nd  { background: #46a67c; }
.share-btn svg { flex-shrink: 0; }

.share-toast {
  margin: 0 1.75rem 1.5rem;
  padding: .65rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dk);
  font-size: .88rem;
  text-align: center;
  animation: shareToastIn .25s ease;
}
.share-toast a { color: var(--coral); }
@keyframes shareToastIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* flatpickr — visible alt-input needs to match the rest of the form,
   and the calendar popup should pick up our teal accent color. */
.rental-field input.flatpickr-input,
.rental-field input.form-control.input {
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
  cursor: pointer;
}
.rental-field input.flatpickr-input:focus,
.rental-field input.form-control.input:focus {
  outline: none; border-color: var(--teal-dk);
  box-shadow: 0 0 0 2px rgba(31, 90, 104, .15);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--coral) !important;
  border-color: var(--coral) !important;
  color: #fff !important;
}
.flatpickr-day.today { border-color: var(--teal-dk); }
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday { color: var(--teal-dk); }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--teal-dk); font-weight: 600; }

/* Inline rental agreement (Step 4) — terms scrollbox, DL radio
   chooser, signature canvas. Same visual language as the /agreement/
   page but rendered directly in the booking flow. */
.agreement-terms-box {
  background: #fbf8f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: .92rem;
  line-height: 1.55;
  max-height: 280px;
  overflow-y: auto;
  margin: .85rem 0 1rem;
}
.agreement-terms-box h4 { color: var(--teal-dk); margin: .85rem 0 .25rem; font-size: .95rem; }
.agreement-terms-box h4:first-child { margin-top: 0; }
.agreement-terms-box p { margin: .5rem 0; }
.agreement-terms-box:focus-within { outline: 2px solid var(--teal-dk); outline-offset: 2px; }

/* Read-through gate: agree-check gets locked until the customer has
   scrolled through the terms box. When enabled we swap the amber
   "Scroll to the bottom" hint for a green "You've read the agreement."
   confirmation via the .scroll-complete state on the hint. */
.agree-check {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem 1.15rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin: .35rem 0 1rem;
  cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, background .15s ease;
}
.agree-check.locked {
  opacity: .5; cursor: not-allowed; background: var(--bg-alt);
}
.agree-check.locked input { pointer-events: none; }
.agree-check:not(.locked):hover { border-color: var(--teal-dk); }
.agree-check input { margin-top: 4px; }
.agree-check input:checked ~ span { color: var(--teal-dk); }
.agree-check.checked { border-color: var(--coral); background: #fff9f4; }

#agreement-scroll-hint.scroll-complete { color: #1e4a2b; }
#agreement-scroll-hint.scroll-complete::before { content: "✓ "; }

/* Field-level required-field highlight. Set on any input that failed
   validation at submit time; cleared as soon as the user starts
   editing that field. */
.rental-field.field-error input,
.rental-field.field-error textarea,
input.field-error, textarea.field-error {
  border-color: #c2261a !important;
  box-shadow: 0 0 0 2px rgba(194, 38, 26, .15);
}
.dl-drop.field-error {
  border-color: #c2261a !important;
  background: #fde9e6;
}
.sig-box.field-error {
  border-color: #c2261a !important;
  background: #fde9e6;
}
.agree-check.field-error {
  border-color: #c2261a !important;
  background: #fde9e6;
}

.fleet-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fleet-cart {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .75rem; background: var(--bg-alt);
  opacity: .5;
}
.fleet-cart.rented {
  opacity: 1; background: #fff;
  border: 2px solid var(--coral); box-shadow: 0 4px 14px rgba(232,90,79,.15);
  position: relative;
}
.fleet-cart.rented::after {
  content: "RENTED"; position: absolute; top: -8px; right: 8px;
  background: var(--coral); color: #fff; font: 700 .65rem inherit;
  letter-spacing: .08em; padding: 2px 7px; border-radius: 999px;
}
.fleet-cart h5 { margin: 0 0 .2rem; color: var(--teal-dk); font-size: .9rem; }
.fleet-cart .meta { font-size: .78rem; color: var(--ink-soft); line-height: 1.35; }
.fleet-cart .meta code { font-family: ui-monospace, monospace; font-size: .76rem; background: rgba(0,0,0,.04); padding: 1px 4px; border-radius: 3px; }

.dl-choice { display: flex; flex-direction: column; gap: .4rem; }
.dl-radio {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .65rem .85rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer;
}
.dl-radio:hover { border-color: var(--teal-dk); }
.dl-radio input { margin-top: 3px; }
.dl-radio small { color: var(--ink-soft); }

/* DL drop zone. The <input type="file"> lives visually hidden; the
   full-width <label> acts as the click/tap target and styles itself
   as a friendly upload card. Empty and preview states swap via the
   [hidden] attribute on their inner elements. */
.dl-upload-box { margin-top: .85rem; }
.dl-drop {
  display: block;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dl-drop:hover, .dl-drop:focus-within {
  border-color: var(--coral);
  background: #fff9f4;
}
.dl-drop-icon { font-size: 2rem; line-height: 1; margin-bottom: .5rem; }
.dl-drop-headline { font-weight: 700; color: var(--teal-dk); font-size: 1rem; }
.dl-drop-sub { color: var(--ink-soft); font-size: .82rem; margin-top: .25rem; }
.dl-drop-empty[hidden], .dl-drop-preview[hidden] { display: none !important; }
.dl-drop-empty { display: block; }
.dl-drop-preview { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.dl-drop-preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: block;
}
.dl-drop-replace {
  color: var(--coral); font-weight: 600; font-size: .88rem;
}

.sig-box {
  border: 2px dashed var(--line); border-radius: 8px;
  background: #fff; padding: .35rem;
}
.sig-canvas {
  width: 100%; height: 180px; display: block; touch-action: none;
  cursor: crosshair; border-radius: 4px;
}
.sig-controls {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .35rem; font-size: .82rem; color: var(--ink-soft);
  flex-wrap: wrap; gap: .5rem;
}
.sig-controls button {
  background: transparent; border: none; color: var(--coral);
  cursor: pointer; font: inherit; padding: 0;
}
.sig-controls button:hover { text-decoration: underline; }

/* Clover Ecommerce SDK renders each card field into a <div> we mount
   an iframe inside; we style the container to match the rest of the
   form and Clover styles the iframe contents via their initialize()
   `styles` option, set in rentals.js. */
.clover-field {
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
}
.clover-field.CloverFocus { border-color: var(--teal-dk); box-shadow: 0 0 0 2px rgba(31,90,104,.15); }
.clover-field.CloverInvalid { border-color: #c2261a; }

/* Info callouts on the review step — one for the payment requirements
   list, one for the cancellation policy, one for the deposit note. */
.rental-info-box {
  background: #fff9f4;
  border: 1px solid #f3c3bc;
  border-radius: 10px;
  padding: .9rem 1.15rem;
  margin: 1rem 0;
  font-size: .95rem;
}
.rental-info-box ul { margin: .35rem 0 0; }
.rental-info-box a { color: var(--teal-dk); }

.rental-meta { font-size: .85rem; color: var(--ink-soft); margin: .8rem 0 0; }
.rental-meta code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.rental-error {
  background: #fff4e6; color: #8a4a00;
  border: 1px solid #f3c98a; border-radius: 8px;
  padding: .6rem .85rem; font-size: .9rem; margin: 1rem 0 0;
}
.rental-fineprint { font-size: .82rem; color: var(--ink-soft); margin: 1.25rem auto 0; max-width: 56ch; text-align: center; }
.rental-cta-row { margin-top: 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.rental-cta-row.center { justify-content: center; }
.rental-cta-row .btn { min-width: 200px; }

/* Choice cards (delivery, etc.) */
.rental-fieldset { border: none; padding: 0; margin: 1.5rem 0 0; }
.rental-fieldset legend { font: 600 .9rem inherit; color: var(--ink); padding: 0 0 .5rem; }
.rental-choice {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: .65rem;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.rental-choice input[type="radio"] {
  flex-shrink: 0;
  accent-color: var(--coral);
  width: 20px; height: 20px;
}
.rental-choice-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rental-choice-body b { color: var(--ink); }
.rental-choice-body small { color: var(--ink-soft); font-size: .85rem; }
.rental-choice-price { color: var(--teal-dk); font-size: 1.05rem; }
.rental-choice:hover { background: #fff; }
.rental-choice:has(input:checked) { border-color: var(--coral); background: #fff; box-shadow: 0 4px 16px rgba(232,90,79,.1); }

/* ========== Cart grid (step 2) ========== */
.cart-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-bottom: 6rem; /* leave room for sticky total bar on mobile */
}
.cart-tile {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cart-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cart-tile.selected { border-color: var(--coral); box-shadow: 0 8px 28px rgba(232,90,79,.18); }

/* Booked-for-these-dates state: tile is visible (so the customer
   still sees the inventory) but grayed out, non-interactive, and
   wears an overlay badge. */
.cart-tile.booked {
  opacity: .58;
  filter: grayscale(.9);
  pointer-events: none;
}
.cart-tile.booked:hover { transform: none; box-shadow: var(--shadow-sm); }
.cart-booked-overlay {
  position: absolute;
  top: .65rem; left: .65rem;
  background: rgba(20,50,58,.92);
  color: #fff;
  font: 700 .72rem inherit;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .35rem .6rem;
  border-radius: 999px;
  z-index: 2;
}
.cart-tile img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  display: block;
}
.cart-tile-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.cart-tile h3 { margin: 0; font-size: 1.05rem; color: var(--teal-dk); }
.cart-tile .badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .25rem 0 .35rem; }
.cart-tile .badge {
  background: var(--bg); color: var(--ink-soft);
  font: 600 .72rem inherit; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line);
}
.cart-tile .badge.cart-serial {
  font-family: ui-monospace, monospace; text-transform: none; letter-spacing: 0;
}
.cart-tile .desc { color: var(--ink-soft); font-size: .88rem; margin: 0; min-height: 2.4rem; }
.cart-tile .footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: .85rem;
}
.cart-tile .price { font: 700 1.15rem Georgia, serif; color: var(--ink); }
.cart-tile .price small { font: 400 .75rem -apple-system, sans-serif; color: var(--ink-soft); }

.stepper {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px;
}
.stepper button {
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: var(--bg-alt);
  color: var(--teal-dk);
  font: 700 1.2rem inherit;
  cursor: pointer;
  line-height: 1;
}
.stepper button:hover { background: var(--teal-dk); color: #fff; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; background: var(--bg-alt); color: var(--ink-soft); }
.stepper b { min-width: 24px; text-align: center; font-size: 1.05rem; color: var(--ink); }
.cart-tile.selected .stepper { background: #ffe9e6; border-color: var(--coral); }

/* Inline Step 2 total + Continue CTA. Previously floated fixed at the
   bottom of the viewport — pulled per owner request so every step's
   CTA sits inline in the natural page flow. */
.rental-total {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.rental-total-line { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rental-total-line span:first-child { color: var(--ink-soft); font-size: .82rem; }
.rental-total-line b { font: 700 1.25rem Georgia, serif; color: var(--ink); }
.rental-total .btn { white-space: nowrap; min-width: 180px; }

/* Summary block (steps 4 and 5) */
.rental-summary {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: .94rem;
}
.rental-summary .row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .25rem 0;
}
.rental-summary .row.total {
  border-top: 1.5px solid var(--line);
  padding-top: .75rem; margin-top: .35rem;
  font: 700 1.15rem Georgia, serif;
}
.rental-summary .row span:last-child { font-variant-numeric: tabular-nums; }
.rental-summary .group-discount span:last-child { color: var(--coral); font-weight: 600; }
.rental-summary .row.muted { color: var(--ink-soft); font-size: .85rem; padding-top: 0; }

/* Confirmation */
.rental-check {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff; font: 700 3.5rem/80px inherit;
  margin: 0 auto 1rem;
  animation: rental-pop .35s ease-out;
}
@keyframes rental-pop {
  from { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}
.rental-confirm code {
  font: 700 1.05rem ui-monospace, "SF Mono", monospace;
  background: var(--bg); padding: 4px 10px; border-radius: 6px;
}

.rental-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-soft);
  font-size: .85rem;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}

/* Hide step sections with this attribute */
.rental-step[hidden] { display: none !important; }
