/* Tokens del sistema "Nocturne" usado en el diseño de la app */
/* Inter variable servida desde /vendor (node_modules/@fontsource-variable/inter): sin CDN, precacheable. */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/inter/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/inter/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --bg: #161826;
  --surface: #232532;
  --text: #e9e9ed;
  --accent: #9184d9;
  --accent-300: #d2cefd;
  --accent-800: #423a6a;
  --n200: #e4e7f5;
  --n300: #cfd3e5;
  --n400: #b2b6ca;
  --n500: #9397ab;
  --n600: #75798c;
  --n700: #595d6c;
  --n800: #3f424d;
  --n900: #292b31;
  --ok: #5fd68a;
  --warn: #ffb163;
  --err: #f27272;
  --divider: color-mix(in srgb, #e9e9ed 16%, transparent);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 0 0 1px var(--n800);
  --shadow-md: 0 0 0 1px var(--n700), 0 6px 18px rgba(0, 0, 0, 0.55);
  --font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ───── layout móvil ───── */
.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* safe areas: notch / isla dinámica (status bar translúcida en iOS) y barra de gestos */
  padding:
    calc(16px + env(safe-area-inset-top))
    calc(20px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
}
.screen-top { display: flex; align-items: center; gap: 14px; padding-top: 4px; }
.screen-actions { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.sticky-actions {
  position: sticky; bottom: 0; margin: auto -20px 0; padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}

h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
.title { font-size: 28px; margin: 18px 0 6px; }
.subtitle { color: var(--n300); margin: 0 0 14px; display: flex; gap: 8px; align-items: flex-start; }
.subtitle i { color: var(--accent); margin-top: 3px; }
.muted { color: var(--n400); }
.small { font-size: 14px; }

/* ───── botones grandes (se usan con una mano, en la obra) ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 20px; border-radius: var(--r-lg);
  border: 2px solid transparent; background: transparent;
  font-size: 18px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text);
  transition: background .15s, transform .05s;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #161826; }
.btn-primary:hover { background: #a296e6; }
.btn-secondary { border: 1.5px solid var(--n600); background: var(--bg); }
.btn-secondary:hover { background: color-mix(in srgb, var(--text) 7%, var(--bg)); }
.btn-ghost { color: var(--accent); min-height: 56px; padding: 0 12px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-xl { min-height: 64px; font-size: 19px; }
.btn-icon { width: 56px; min-height: 56px; height: 56px; padding: 0; flex-shrink: 0; font-size: 22px; }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 12px; border-radius: var(--r-md); }

/* ───── formularios ───── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 15px; color: var(--n300); }
.input {
  width: 100%; min-height: 56px; padding: 10px 14px; font-size: 18px;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--divider); border-radius: var(--r-lg);
  caret-color: var(--accent);
}
.input::placeholder { color: var(--n500); opacity: 1; }
.input:hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea.input { min-height: 96px; resize: vertical; font-size: 16px; }
.input-sm { min-height: 44px; font-size: 16px; border-radius: var(--r-md); padding: 6px 10px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.hint { font-size: 14px; color: var(--n400); }

.panel {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.panel .input { background: var(--bg); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.panel-title i { color: var(--accent); font-size: 22px; }

.alert {
  padding: 12px 14px; border-radius: var(--r-md); font-size: 15px;
  background: color-mix(in srgb, var(--err) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--err) 50%, transparent);
  color: #ffd0d0;
}
.alert-info {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-300);
}

/* ───── pasos ───── */
.steps-head { flex: 1; }
.steps-label { font-size: 15px; color: var(--n300); font-weight: 500; }
.steps-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.steps-bar span { height: 6px; border-radius: 3px; background: var(--n800); }
.steps-bar span.on { background: var(--accent); }

/* ───── selector de tamaño / opciones ───── */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--n800); cursor: pointer;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-icon { font-size: 30px; color: var(--accent); }
.option-body { flex: 1; min-width: 0; }
.option-name { font-weight: 600; font-size: 17px; }
.option-desc { font-size: 14px; color: var(--n400); }
.option-price { font-weight: 700; font-size: 18px; white-space: nowrap; }

/* ───── mapa ───── */
.map-wrap { position: relative; margin: 0 -20px; flex: 1; min-height: 340px; }
#mapa { position: absolute; inset: 0; background: var(--n900); }
.map-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  font-size: 46px; color: var(--accent); pointer-events: none; z-index: 500;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6));
}
.map-floating { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 500; }
.map-search.suggest { position: absolute; top: 12px; left: 16px; right: 16px; z-index: 600; }
.map-search .input { min-height: 56px; font-size: 16px; padding-left: 44px; box-shadow: var(--shadow-md); background: var(--bg); }
.map-search > i { position: absolute; left: 14px; top: 17px; font-size: 20px; color: var(--n400); z-index: 1; }
.leaflet-container { font-family: var(--font); background: var(--n900); }
.leaflet-tile-pane { filter: brightness(.72) contrast(1.1) saturate(.6) invert(.92) hue-rotate(185deg); }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(22,24,38,.75) !important; color: var(--n400) !important; }
.leaflet-control-attribution a { color: var(--n300) !important; }

.address-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0 4px; }
.address-card i { font-size: 24px; color: var(--accent); margin-top: 2px; }
.address-main { font-size: 20px; font-weight: 600; }
.address-sub { font-size: 15px; color: var(--n300); }

/* ───── sugerencias (autocomplete) ───── */
.suggest { position: relative; }
.suggest-list {
  list-style: none; margin: 6px 0 0; padding: 0; border-radius: var(--r-lg); background: var(--bg);
  box-shadow: var(--shadow-md); overflow: hidden; position: absolute; left: 0; right: 0; z-index: 700;
}
.suggest-list li button {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border: 0; background: transparent; font-size: 17px; text-align: left; cursor: pointer;
}
.suggest-list li + li button { border-top: 1px solid var(--n800); }
.suggest-list li button:hover, .suggest-list li button:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.suggest-list i { color: var(--accent); }
.suggest-list .dist { margin-left: auto; font-size: 13px; color: var(--n400); white-space: nowrap; }
.suggest-list .sub { font-size: 13px; color: var(--n400); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--n700);
  background: var(--bg); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--accent); }
.chip .dist { font-size: 12px; color: var(--n400); }

/* ───── foto ───── */
.photo-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 300px; border-radius: var(--r-lg); border: 2px dashed var(--n700); background: var(--surface);
  text-align: center; padding: 20px; cursor: pointer; color: var(--n300);
}
.photo-drop i { font-size: 54px; color: var(--accent); }
.photo-drop:hover { border-color: var(--accent); }
.photo-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.photo-preview img { width: 100%; max-height: 52vh; object-fit: cover; }
.photo-ok {
  position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px;
  background: rgba(22,24,38,.85); padding: 6px 10px; border-radius: 999px; font-size: 14px;
}
.photo-ok i { color: var(--ok); }

/* ───── resumen ───── */
.summary { display: flex; flex-direction: column; gap: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.summary-row { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.summary-row + .summary-row { border-top: 1px solid var(--n800); }
.summary-row > i { font-size: 22px; color: var(--accent); margin-top: 1px; }
.summary-row .k { font-size: 13px; color: var(--n400); }
.summary-row .v { font-size: 16px; font-weight: 500; }
.summary-thumb { width: 64px; height: 64px; border-radius: var(--r-md); object-fit: cover; margin-left: auto; }
.total { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 2px; }
.total .amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

/* ───── estado ───── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; border: 1.5px solid currentColor;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.badge.lg { height: 38px; font-size: 16px; padding: 0 14px; }
.st-pendiente_pago { color: var(--warn); }
.st-pagado { color: #7fb2ff; }
.st-confirmado { color: #4dd0c8; }
.st-en_camino { color: #ff7ab6; }
.st-colocado { color: var(--ok); }
.st-retirado { color: var(--n400); }
.st-cancelado { color: var(--err); }

/* ───── lista de pedidos ───── */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
}
.list-item:hover { box-shadow: 0 0 0 1px var(--n600); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 14px; color: var(--n400); }
.empty { text-align: center; padding: 30px 10px; color: var(--n400); }

.hero {
  border-radius: 20px; padding: 22px; margin: 14px 0 22px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 35%, var(--surface)) 0%, var(--surface) 60%);
  box-shadow: var(--shadow-sm);
}
.hero h2 { font-size: 24px; margin-bottom: 6px; }
.hero p { color: var(--n300); margin: 0 0 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: var(--bg); font-size: 22px;
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--r-lg); margin: 18px 0; }
.tabs button { min-height: 52px; border: 0; border-radius: 11px; background: transparent; font-size: 16px; font-weight: 600; color: var(--n400); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2000;
  background: var(--surface); box-shadow: var(--shadow-md); padding: 12px 18px; border-radius: var(--r-md); font-size: 15px;
  max-width: calc(100% - 32px);
}

/* ───── desglose de cobro: servicio (MP) + volquete (en persona) ───── */
.option-price { display: flex; flex-direction: column; align-items: flex-end; }
.option-fee { font-size: 12px; font-weight: 500; color: var(--n400); }
.cobro { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cobro-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm);
}
.cobro-ahora { box-shadow: 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cobro-k { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.cobro-k i { color: var(--accent); }
.cobro-d { font-size: 13px; color: var(--n400); }
.cobro-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.cobro-ahora .cobro-v { font-size: 26px; }

/* ───── wordmark volque.ar ───── */
.wordmark { font-weight: 700; letter-spacing: -0.02em; font-size: 19px; }
.wordmark .tld { color: var(--accent); }

/* ───── sensación de app nativa ───── */
.title:focus { outline: none; }
.title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.sticky-actions { padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
.map-wrap { margin-left: calc(-20px - env(safe-area-inset-left)); margin-right: calc(-20px - env(safe-area-inset-right)); }

/* transición entre pasos del asistente */
.entra-adelante { animation: entra-adelante .26s cubic-bezier(.2, .8, .2, 1); }
.entra-atras { animation: entra-atras .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes entra-adelante { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes entra-atras { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .entra-adelante, .entra-atras { animation: none; }
  .spinner { animation-duration: 2.4s; }
  .btn { transition: none; }
}

.foto-acciones { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }

/* borrador sin terminar (inicio) */
.borrador-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin: -8px 0 18px;
  border-radius: var(--r-lg); text-decoration: none; color: inherit;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--warn) 55%, transparent);
}
.borrador-card > i { font-size: 30px; color: var(--warn); }
.borrador-card .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.borrador-card .t { font-weight: 600; }
.borrador-card .s { font-size: 14px; color: var(--n300); }

/* botón "Instalar app" (se oculta solo si ya está instalada) */
.instalar { margin: -6px 0 22px; }
.standalone .instalar { display: none !important; }

/* barra "sin conexión" */
.offline-bar {
  position: sticky; top: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; font-size: 14px; font-weight: 600;
  background: var(--warn); color: #161826; text-align: center;
}

/* hoja con instrucciones para iOS */
dialog.sheet {
  width: min(480px, 100%); max-width: 100%; margin: auto auto 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border: 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md);
}
dialog.sheet::backdrop { background: rgba(8, 9, 16, .7); }
dialog.sheet[open] { animation: sube .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
dialog.sheet h2 { font-size: 22px; margin-bottom: 14px; }
.pasos-ios { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pasos-ios li { display: flex; gap: 12px; align-items: center; font-size: 17px; }
.pasos-ios i { color: var(--accent); font-size: 22px; vertical-align: -4px; }
.paso-n {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-800); color: var(--accent-300); font-weight: 700;
}
dialog.sheet .hint { margin: 0 0 16px; }

/* pantalla sin conexión */
.screen-center { justify-content: center; }
.offline-box { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.offline-box h1 { font-size: 26px; }
.offline-box p { margin: 0 0 8px; }
.offline-icono { font-size: 72px; color: var(--accent); }
