/* E-Charge: a thin layer over Bootstrap 5.3. Everything else comes from Bootstrap's own variables. */
:root {
  --ec-green: #157347;
  --ec-green-dark: #0e5a37;
  --ec-green-soft: #eaf6ef;
  --ec-ink: #1f2933;
  --ec-muted: #5f6b76;
  --ec-line: #e3e8ee;
  --ec-radius: .75rem;
  --ec-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 12px rgba(16, 24, 40, .06);
  --bs-success: var(--ec-green);
  --bs-success-rgb: 21, 115, 71;
  --bs-link-color: var(--ec-green);
  --bs-link-hover-color: var(--ec-green-dark);
  --bs-link-color-rgb: 21, 115, 71;
  --bs-body-color: var(--ec-ink);
  --bs-border-color: var(--ec-line);
}

body { background: #f7f9fb; color: var(--ec-ink); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
body > footer { margin-top: auto; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; }
main { padding-bottom: 3rem; min-height: 60vh; }
.text-muted, .form-text { color: var(--ec-muted) !important; }

/* ---- Buttons and focus ---------------------------------------------------------------------------------------- */
.btn-success { --bs-btn-bg: var(--ec-green); --bs-btn-border-color: var(--ec-green); --bs-btn-hover-bg: var(--ec-green-dark);
  --bs-btn-hover-border-color: var(--ec-green-dark); --bs-btn-active-bg: var(--ec-green-dark); --bs-btn-active-border-color: var(--ec-green-dark);
  --bs-btn-disabled-bg: var(--ec-green); --bs-btn-disabled-border-color: var(--ec-green); }
.btn-outline-success { --bs-btn-color: var(--ec-green); --bs-btn-border-color: var(--ec-green); --bs-btn-hover-bg: var(--ec-green);
  --bs-btn-hover-border-color: var(--ec-green); --bs-btn-active-bg: var(--ec-green); --bs-btn-active-border-color: var(--ec-green); }
.btn { font-weight: 500; border-radius: .6rem; }
.btn-lg { padding: .75rem 1.25rem; }
:focus-visible { outline: 3px solid rgba(21, 115, 71, .45); outline-offset: 2px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--ec-green); box-shadow: 0 0 0 .25rem rgba(21, 115, 71, .18); }
.form-check-input:checked { background-color: var(--ec-green); border-color: var(--ec-green); }
.form-label { font-weight: 500; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
.btn[aria-busy="true"]::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .55em; vertical-align: -.1em;
  border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ec-spin .7s linear infinite; }
@keyframes ec-spin { to { transform: rotate(360deg); } }

/* ---- Navbar --------------------------------------------------------------------------------------------------- */
.navbar-echarge { background: linear-gradient(90deg, var(--ec-green-dark), var(--ec-green)); box-shadow: 0 1px 0 rgba(0,0,0,.08); margin-bottom: 1.75rem; }
.navbar-echarge .navbar-brand { font-weight: 700; letter-spacing: -.02em; }
.navbar-echarge .nav-link, .navbar-echarge .dropdown-toggle { color: rgba(255, 255, 255, .92); border-radius: .5rem; padding: .5rem .75rem; }
.navbar-echarge .nav-link:hover, .navbar-echarge .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .12); }
.navbar-echarge .nav-link.active { color: #fff; background: rgba(255, 255, 255, .18); font-weight: 600; }
.navbar-echarge .dropdown-menu { border: 1px solid var(--ec-line); border-radius: .75rem; box-shadow: var(--ec-shadow); padding: .4rem; min-width: 13rem; }
.navbar-echarge .dropdown-item { border-radius: .5rem; padding: .5rem .75rem; }
.navbar-echarge .dropdown-item.active, .navbar-echarge .dropdown-item:active { background: var(--ec-green-soft); color: var(--ec-green-dark); font-weight: 600; }
.dropdown-item .badge { margin-left: .4rem; }
.navbar-toggler { position: relative; }
.toggler-count { position: absolute; top: -.45rem; right: -.45rem; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: #ffc107; color: #1f2328; font-size: .75rem; font-weight: 700; line-height: 1.3rem; }
.skip-link { position: absolute; left: .5rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem .9rem; border-radius: .5rem; }

/* ---- Cards, alerts, badges ------------------------------------------------------------------------------------ */
.card { border: 1px solid var(--ec-line); border-radius: var(--ec-radius); box-shadow: var(--ec-shadow); }
.card-footer { background: transparent; border-top-color: var(--ec-line); }
.alert { border: 0; border-radius: var(--ec-radius); position: relative; padding-left: 2.75rem; }
.alert::before { font-weight: 700; position: absolute; left: 1.1rem; top: 1rem; width: 1.2rem; text-align: center; line-height: 1.5; }
.alert-success { background: #e3f4ea; color: #0f5132; } .alert-success::before { content: "✓"; }
.alert-danger { background: #fdeaea; color: #8a1c1c; } .alert-danger::before { content: "!"; }
.alert-warning { background: #fff4d6; color: #664d03; } .alert-warning::before { content: "⏱"; }
.alert-info { background: #e5f1fb; color: #0b4a77; } .alert-info::before { content: "i"; font-style: italic; }
.badge { font-weight: 600; letter-spacing: .01em; }
.badge.text-bg-light { background: #fff !important; color: var(--ec-ink) !important; border: 1px solid var(--ec-line) !important; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 2rem; background: #fff; border: 1px solid var(--ec-line); font-size: .85rem; }
.section-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ec-muted); }
.card h2.h6 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; }

/* ---- Home ------------------------------------------------------------------------------------------------------ */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #d4efdf 0, transparent 60%), linear-gradient(135deg, #eaf6ef, #f7fbf8); border: 1px solid #d6eadd; border-radius: 1.25rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; line-height: 1.1; }
.hero .lead { color: #33414d; max-width: 34rem; }
.preview-card { transform: rotate(1.5deg); max-width: 22rem; margin-inline: auto; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--ec-green); color: #fff; font-weight: 700; display: grid; place-items: center; }
.trust { background: #fff; border: 1px solid var(--ec-line); border-radius: var(--ec-radius); padding: 1.1rem 1.2rem; height: 100%; }
.trust .icon { font-size: 1.5rem; line-height: 1; }
.cta-band { background: var(--ec-green-dark); color: #fff; border-radius: 1.25rem; }
.cta-band .btn-light { color: var(--ec-green-dark); font-weight: 600; }

/* ---- Auth ------------------------------------------------------------------------------------------------------ */
.auth-wrap { max-width: 26rem; margin: 1rem auto 0; }
.auth-wrap .card { box-shadow: var(--ec-shadow); }
.narrow { max-width: 34rem; }
.narrow-wide { max-width: 50rem; }

/* ---- Maps ------------------------------------------------------------------------------------------------------ */
#pin-map, #public-map { height: 20rem; border-radius: var(--ec-radius); border: 1px solid var(--ec-line); }
#pin-map { cursor: crosshair; }
#search-map { height: 34rem; border-radius: var(--ec-radius); border: 1px solid var(--ec-line); box-shadow: var(--ec-shadow); }
/* Leaflet stacks its panes up to z-index 1000; keep them inside the map so the navbar menus and the sticky Save bar
   stay on top of it. */
.leaflet-container { font-family: inherit; isolation: isolate; }

/* ---- Search results --------------------------------------------------------------------------------------------- */
.result-item { cursor: pointer; transition: background .12s ease, box-shadow .12s ease; }
.result-item:hover, .result-item.is-active { background: var(--ec-green-soft); }
.result-item:first-child { border-top-left-radius: var(--ec-radius); border-top-right-radius: var(--ec-radius); }
.result-item:last-child { border-bottom-left-radius: var(--ec-radius); border-bottom-right-radius: var(--ec-radius); }
#results { box-shadow: var(--ec-shadow); border-radius: var(--ec-radius); }

/* ---- Charger page ----------------------------------------------------------------------------------------------- */
.price-tag { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.spec-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.hours-list { list-style: none; padding: 0; margin: 0; }
.hours-list li { padding: .3rem 0; border-bottom: 1px dashed var(--ec-line); } .hours-list li:last-child { border: 0; }
.review-quote { border-left: 3px solid var(--ec-green); padding-left: .9rem; }

/* ---- Booking progress ----------------------------------------------------------------------------------------- */
.tracker { display: flex; align-items: flex-start; gap: 0; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.tracker li { flex: 1; text-align: center; position: relative; font-size: .82rem; color: var(--ec-muted); }
.tracker li::before { content: ""; position: absolute; top: .72rem; left: -50%; width: 100%; height: 3px; background: var(--ec-line); z-index: 0; }
.tracker li:first-child::before { display: none; }
.tracker .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin: 0 auto .35rem; border-radius: 50%;
  background: #fff; border: 3px solid var(--ec-line); font-size: .7rem; font-weight: 700; }
.tracker li.done { color: var(--ec-ink); } .tracker li.done::before { background: var(--ec-green); }
.tracker li.done .dot { background: var(--ec-green); border-color: var(--ec-green); color: #fff; }
.tracker li.current { color: var(--ec-ink); font-weight: 600; } .tracker li.current .dot { border-color: var(--ec-green); color: var(--ec-green); }
.tracker li.current::before { background: var(--ec-green); }
.tracker.is-ended li.current .dot { border-color: #8b97a3; color: #8b97a3; }
.address-card { border-left: 4px solid var(--ec-green); background: var(--ec-green-soft); }

/* ---- Forms ------------------------------------------------------------------------------------------------------ */
.form-section > h2 { font-size: 1.05rem; font-weight: 700; }
.form-actions { position: sticky; bottom: 0; z-index: 10; background: linear-gradient(to top, #f7f9fb 70%, rgba(247, 249, 251, 0)); padding: 1.25rem 0 1rem; margin-top: 1rem; }
.window-note:empty { display: none; }
/* Search: the form, then the map (so "tap the map" is next to it on a phone), then the results; on a wide screen the
   map sits to the right of both and stays in view. */
.search-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); grid-template-areas: "form" "map" "results"; }
.search-form-area { grid-area: form; }
.search-map-area { grid-area: map; }
.search-results-area { grid-area: results; }
.search-layout #search-form { margin-bottom: 0; }
@media (max-width: 991.98px) { .search-layout { gap: 1rem; } }
@media (min-width: 992px) {
  .search-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "form map" "results map"; align-items: start; }
  .search-form-area, .search-results-area { min-width: 0; }
  .search-map-area { align-self: stretch; }
}
/* Stars in a dark amber: Bootstrap's yellow is unreadable on white. */
.stars { color: #9a6700; letter-spacing: .05em; }
/* On a phone one finger scrolls the page and two move the map; a hint says so when one finger lands on it. */
.map-hint { position: absolute; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; text-align: center;
  background: rgba(16, 24, 32, .45); color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; }
.map-hint.show { opacity: 1; }
#pick-fields.is-idle { opacity: .6; }
#pick-fields.is-idle:hover, #pick-fields.is-idle:focus-within { opacity: 1; }
.form-control::placeholder { color: #6c757d; opacity: 1; }
.rating-choices .form-check-inline { margin-right: .6rem; }
.preset-bar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }

.booking-card.needs-action { border-left: 4px solid #ffc107; }

/* A self-refreshing page that can't reach the server says so, pinned to the bottom of the screen. */
.live-stale { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1080; max-width: calc(100% - 2rem);
  padding: .5rem 1rem; border-radius: 1rem; background: var(--ec-ink); color: #fff; box-shadow: var(--ec-shadow); text-align: center; }
.live-stale[hidden] { display: none; }

/* ---- When a charger is free ---------------------------------------------------------------------------------------- */
.now-badge { font-weight: 600; }
.now-badge .now-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: currentColor; margin-right: .4em; vertical-align: .05em; }
.sched-nav > .btn { flex: 0 0 auto; min-width: 2.25rem; }
.sched-nav > form { min-width: 0; }
.sched-bar { display: flex; height: 1.6rem; border-radius: .5rem; overflow: hidden; border: 1px solid var(--ec-line); background: #fff; }
.sched-seg { height: 100%; min-width: 0; }
.sched-seg.free, .sched-swatch.free { background: #6fcf97; }
.sched-seg.booked, .sched-swatch.booked { background: repeating-linear-gradient(135deg, #f2a93b 0 6px, #f8cf86 6px 12px); }
.sched-seg.closed, .sched-swatch.closed { background: #e6eaee; }
.sched-seg.past, .sched-seg.too_far { background: #f1f3f5; }
.sched-axis { position: relative; height: 1.1rem; margin: .15rem .5rem 0; font-size: .7rem; color: var(--ec-muted); }
.sched-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sched-axis span:first-child { transform: none; margin-left: -.5rem; }
.sched-axis span:last-child { transform: translateX(-100%); margin-left: .5rem; }
.sched-swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: .25rem; border: 1px solid var(--ec-line); margin-right: .35rem; vertical-align: -.15rem; }
.sched-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--ec-line); }
.sched-row:last-child { border-bottom: 0; }
.sched-tag { min-width: 4.2rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sched-tag.free { color: #14683f; }
.sched-tag.booked { color: #8a5a00; }
#schedule[aria-busy="true"] { opacity: .6; }

/* ---- Footer ------------------------------------------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--ec-line); color: var(--ec-muted); font-size: .85rem; padding: 1.5rem 0 2rem; margin-top: 1rem; background: #fff; }

/* ---- Small screens ----------------------------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  main.container { padding-left: 1rem; padding-right: 1rem; }
  .hero { border-radius: 1rem; }
  .preview-card { transform: none; }
  #search-map { height: 18rem; }
  #pin-map, #public-map { height: 16rem; }
  .price-tag { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Payout details: only the chosen method's fields (no script needed). */
.payout-form:has(#method-upi:checked) .bank-fields,
.payout-form:has(#method-bank:checked) .upi-fields { display: none; }
