/* =====================================================================
   Parking IT · Estilos (inspirados en la identidad Verisure: rojo + blanco)
   ===================================================================== */
:root {
  --red: #E30613;
  --red-dark: #B8000F;
  --red-soft: #FDECEE;
  --ink: #1C1C1E;
  --ink-2: #4A4A50;
  --muted: #8A8A92;
  --line: #E8E8EC;
  --bg: #F6F6F8;
  --card: #FFFFFF;
  --green: #16A34A;  --green-soft: #E8F7EE;
  --yellow: #B7791F; --yellow-soft: #FFF6DB;
  --orange: #DD6B20; --orange-soft: #FFEEDD;
  --blue: #2563EB;   --blue-soft: #E8F0FF;
  --grey-soft: #F0F0F3;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 16, 24, .04), 0 4px 16px rgba(16, 16, 24, .06);
  --nav-h: 64px;
  font-family: 'Inter', 'InterVariable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
@supports (font-variation-settings: normal) { :root { font-family: 'InterVariable', 'Inter', system-ui, sans-serif; } }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F2F2F5; --ink-2: #C9C9D1; --muted: #9A9AA5; --line: #2C2C33;
    --bg: #111114; --card: #1B1B20; --red-soft: #3A1418; --grey-soft: #26262C;
    --green-soft: #12301F; --yellow-soft: #33290F; --orange-soft: #3A2412; --blue-soft: #15223F;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; font-weight: 750; margin: .25rem 0 1rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .5rem; }
p { margin: .25rem 0 .75rem; }
input, select, button, textarea { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; word-break: break-all; }
.center { text-align: center; }
.pad { padding: 1.5rem; }
.grow { flex: 1; }
.link { color: var(--red); font-weight: 600; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- splash ---------- */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.splash-logo, .brand-mark {
  width: 72px; height: 72px; border-radius: 20px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 2.4rem; box-shadow: 0 8px 24px rgba(227, 6, 19, .3);
}
.splash-logo { animation: pulse 1.4s ease-in-out infinite; }
.brand-mark.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 1.1rem; box-shadow: none; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .8; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 1rem 2rem;
  background: linear-gradient(180deg, var(--red) 0, var(--red) 260px, var(--bg) 260px); }
.auth-hero { color: #fff; text-align: center; padding: 3.5rem 1rem 1.5rem; }
.auth-hero .brand-mark { margin: 0 auto 1rem; background: #fff; color: var(--red); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.auth-hero h1 { font-size: 1.8rem; font-weight: 800; }
.auth-hero p { opacity: .9; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .9rem; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: .5rem; font-size: .9rem; }
.auth-links a { color: var(--red); font-weight: 600; }
.lang-switch { margin-top: 1.5rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: .4rem 1rem; color: var(--muted); cursor: pointer; }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .inline-form input, .search, .list-row select, .inline-form select {
  width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 1rem; font-weight: 400; outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--red); }
.inline-form { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
.inline-form input { flex: 1; }
.form-grid { display: grid; gap: .8rem; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }
.check input, .day-check { width: 20px; height: 20px; accent-color: var(--red); }
.search { margin-bottom: 1rem; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: none; border-radius: 12px;
  padding: .75rem 1.1rem; font-weight: 650; font-size: .95rem; cursor: pointer; transition: transform .08s, background .15s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-ghost { background: var(--grey-soft); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-link { background: none; color: var(--red); }
.btn-sm { padding: .45rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: none; padding: .4rem; border-radius: 8px; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--grey-soft); color: var(--red); }

/* ---------- layout ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem;
  padding: calc(.7rem + env(safe-area-inset-top)) 1rem .7rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.05rem; }
.top-link { display: flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: .4rem .7rem; border-radius: 999px; }
.top-link.on, .top-link:hover { background: var(--red-soft); color: var(--red); }
main { max-width: 640px; margin: 0 auto; }
.page { padding: 1.25rem 1rem 2rem; }
.page.wide { max-width: 1000px; margin: 0 auto; }
main:has(.page.wide) { max-width: 1000px; }
.hello span { color: var(--red); }
.demo-ribbon { background: #1F2937; color: #fff; text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .08em; padding: .3rem; }

.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .7rem; font-weight: 600; color: var(--muted); }
.bottomnav a.on { color: var(--red); }
.nav-icon { position: relative; }
.dot { position: absolute; top: -6px; right: -10px; background: var(--red); color: #fff; font-style: normal; font-size: .62rem;
  font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--card); }

/* ---------- tarjetas ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-pending { border: 1.5px dashed var(--yellow); }
.card-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; color: var(--red); }
.card-title h3 { color: var(--ink); margin: 0; }
.place { font-weight: 700; }
.place.big { font-size: 1.35rem; margin: .25rem 0 .5rem; }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.badge-grey { background: var(--grey-soft); color: var(--ink-2); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; align-items: center; }

/* ---------- día ---------- */
.day-card { background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.1rem .8rem; box-shadow: var(--shadow); margin-bottom: 1rem;
  border-left: 5px solid var(--line); }
.day-card.tone-green { border-left-color: var(--green); }
.day-card.tone-yellow { border-left-color: #E0B000; }
.day-card.tone-orange { border-left-color: var(--orange); }
.day-card.tone-blue { border-left-color: var(--blue); }
.day-card.tone-red { border-left-color: var(--red); }
.day-card.compact { padding: .8rem .9rem .6rem; margin-bottom: .6rem; }
.day-card.weekend { opacity: .75; }
.day-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.day-title { flex: 1; }
.day-name { font-weight: 750; font-size: 1.15rem; text-transform: capitalize; }
.compact .day-name { font-size: .98rem; }
.spot-big { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; background: var(--green-soft); border-radius: 12px; margin-bottom: .6rem; color: var(--green); }
.spot-big .place { color: var(--ink); font-size: 1.1rem; }
.compact .spot-big { padding: .45rem .6rem; }
.compact .spot-big .place { font-size: .95rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.day-foot { border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .25rem; }
.offer-line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .7rem; border-radius: 12px; background: var(--grey-soft); margin-bottom: .5rem; }
.offer-line.free { background: var(--red-soft); }
.claim-list { margin: .25rem 0 .5rem; }
.claim-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--red); margin-bottom: .4rem; }
.btn { white-space: nowrap; }
.sticky-action { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + .75rem); z-index: 5; padding-top: .5rem; }
.sticky-action .btn { box-shadow: 0 8px 24px rgba(227, 6, 19, .35); }

/* ---------- listas ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row.weekend { opacity: .7; }
.list-row select { max-width: 60%; padding: .45rem .6rem; font-size: .9rem; }
.row-actions { display: flex; gap: .4rem; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.wrap-row .row-actions { margin-left: auto; }
.nowrap { white-space: nowrap; }
.row-actions.wrap { flex-wrap: wrap; justify-content: flex-end; }
.rows { margin-bottom: .5rem; }
.plate { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; background: var(--grey-soft); padding: .15rem .45rem; border-radius: 6px; border: 1px solid var(--line); }
.spot-code { min-width: 3rem; }
.details { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.details summary { cursor: pointer; font-weight: 650; color: var(--red); margin-bottom: .75rem; }

.notif { background: var(--card); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .5rem; box-shadow: var(--shadow); }
.notif.unread { border-left: 4px solid var(--red); }
.notif-text { margin-bottom: .2rem; }

.profile-head { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 1.3rem; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty .icon { opacity: .5; }

.banner { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem .9rem; border-radius: 12px; margin-bottom: 1rem; font-size: .9rem; }
.banner-info { background: var(--blue-soft); color: var(--ink); }
.banner-info .icon { color: var(--blue); }
.banner-warn { background: var(--yellow-soft); }
.banner-warn .icon { color: var(--yellow); }
.banner-error { background: var(--red-soft); }
.banner-error .icon { color: var(--red); }

/* ---------- admin ---------- */
.tabs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .25rem; scrollbar-width: none; }
.tab { padding: .5rem .9rem; border-radius: 999px; background: var(--card); font-size: .88rem; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); }
.tab.on { background: var(--red); color: #fff; border-color: var(--red); }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.user-row { display: flex; gap: .75rem; justify-content: space-between; flex-wrap: wrap; }
.floor { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.floor-head { display: flex; align-items: center; gap: .5rem; }
.audit .list-row { align-items: flex-start; }

/* ---------- modal y toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 1rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 600px) { .modal-backdrop { align-items: center; } .modal { border-radius: 20px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.modal-head h3 { margin: 0; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 1rem); z-index: 100;
  max-width: min(92vw, 480px); padding: .8rem 1.1rem; border-radius: 12px; color: #fff; font-weight: 600; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: up .2s ease-out; }
.toast-ok { background: #1F2937; }
.toast-warn { background: var(--orange); }
.toast-error { background: var(--red); }

.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
