/* Sistema de diseño Mapiia — tokens y componentes comunes a las dos PWAs.
   Heredado de app/public/app.css (paleta ya coherente); se conserva tal cual. */

:root {
  --ink: #102a2d;
  --ink-soft: #486165;
  --paper: #f5f1e8;
  --card: #fffdf8;
  --line: #dcdad0;
  --sage: #719b83;
  --mint: #b7d3c1;
  --gold: #ebb24d;
  --coral: #e76b5d;
  --blue: #6a9cc1;
  --purple: #8778c7;
  --azul-electrico: #3b5bdb; /* logo Mapiia */
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cat-multisensor: #e76b5d;
  --cat-sentinel2: #ebb24d;
  --cat-sentinel1: #6a9cc1;
  --cat-normal: #719b83;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.brand { align-items: center; display: flex; gap: 12px; }
.brand-mark { align-items: center; background: var(--ink); border-radius: 13px; color: var(--gold); display: inline-flex; font-size: 18px; font-weight: 800; height: 40px; justify-content: center; width: 40px; }
.brand-name { font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.brand-context { border-left: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; margin-left: 4px; padding-left: 14px; }

.button { background: var(--ink); border: 1px solid var(--ink); border-radius: 999px; color: #fffdf8; font-size: 13px; font-weight: 800; padding: 11px 18px; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button:hover, .button:focus-visible { background: #1e4a4c; }
.button.secondary:hover { background: var(--card); }
.button:disabled { opacity: .55; cursor: default; }

/* --- Login ------------------------------------------------------------ */
.login-shell { align-items: center; display: flex; justify-content: center; min-height: 100dvh; padding: 20px; }
.login-card { background: var(--card); border: 1px solid rgba(16,42,45,.09); border-radius: 20px; max-width: 420px; padding: 38px; width: 100%; }
.login-card h1 { font-family: var(--display); font-size: 40px; font-weight: 400; letter-spacing: -.05em; line-height: 1; margin: 18px 0 0; }
.login-card p { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.login-card label { color: var(--ink-soft); display: block; font-size: 11px; font-weight: 800; margin: 16px 0 7px; }
.login-card input { background: var(--paper); border: 1px solid transparent; border-radius: 11px; padding: 13px; width: 100%; }
.login-card input:focus { border-color: var(--mint); outline: 0; }
.login-card .button { margin-top: 20px; width: 100%; }
.login-error { color: var(--coral); font-size: 12px; min-height: 18px; }

/* --- Toast ----------------------------------------------------------- */
.toast { background: var(--ink); border-radius: 12px; bottom: 22px; color: #fffdf8; font-size: 13px; left: 50%; max-width: 90vw; padding: 12px 18px; position: fixed; transform: translateX(-50%); z-index: 9000; }
.toast.hidden { display: none; }

/* --- Hoja modal ---------------------------------------------------- */
.sheet-backdrop { align-items: flex-end; background: rgba(6,7,10,.45); display: flex; inset: 0; justify-content: center; position: fixed; z-index: 8000; }
.sheet-card { background: var(--card); border-radius: 22px 22px 0 0; max-height: 88dvh; max-width: 560px; overflow-y: auto; padding: 26px 22px calc(26px + env(safe-area-inset-bottom)); position: relative; width: 100%; }
@media (min-width: 620px) { .sheet-backdrop { align-items: center; } .sheet-card { border-radius: 22px; } }
.sheet-close { background: var(--paper); border: 0; border-radius: 50%; font-size: 20px; height: 34px; position: absolute; right: 18px; top: 18px; width: 34px; }
.sheet-eyebrow { color: var(--sage); font-size: 11px; font-weight: 900; letter-spacing: .16em; margin: 0; text-transform: uppercase; }
.sheet-title { font-family: var(--display); font-size: 26px; font-weight: 400; letter-spacing: -.04em; margin: 4px 0 16px; }

/* --- MapLibre: controles al estilo Mapiia -------------------------- */
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-group button { height: 34px; width: 34px; }
.maplibregl-ctrl-group button:not(:disabled):hover { background: var(--paper); }

/* --- Flecha de rumbo (heading.mjs) -------------------------------- */
.heading-arrow-wrap { height: 30px; pointer-events: none; width: 30px; z-index: 3; }
.heading-arrow {
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--azul-electrico);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.5));
  height: 0; margin: 0 auto; width: 0;
  transform-origin: 50% 85%;
  transition: transform 250ms ease-out;
}

.hidden { display: none !important; }
