/* Carmoto Detailing — tema compartido (azul neón sobre negro, inspirado en el logo) */
:root {
  color-scheme: dark;
  --bg: #04060d;
  --bg-2: #070b18;
  --surface: #0c1326;
  --surface-2: #111a33;
  --surface-3: #18233f;
  --line: rgba(96, 156, 255, .16);
  --line-2: rgba(96, 156, 255, .28);
  --text: #eaf1ff;
  --text-2: #b3c2e0;
  --muted: #7d8db0;
  --primary: #2f8cff;
  --primary-2: #00c6ff;
  --primary-ink: #04101f;
  --glow: 0 0 0 1px rgba(47,140,255,.35), 0 10px 40px -10px rgba(0,140,255,.55);
  --grad: linear-gradient(135deg, #1565ff 0%, #2f8cff 45%, #00c6ff 100%);
  --good: #22c58b;
  --warn: #f4b33d;
  --bad: #ff5d6c;
  --gift: #ffcc4d;
  --series-ing: #3987e5;
  --series-egr: #d95926;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.8);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 10% -10%, rgba(21,101,255,.18), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(0,198,255,.10), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
svg.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; padding: .7em 1.15em; border-radius: 12px; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: rgba(96,156,255,.5); background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-danger { background: rgba(255,93,108,.12); border-color: rgba(255,93,108,.4); color: #ffb3ba; }
.btn-danger:hover { background: rgba(255,93,108,.2); border-color: rgba(255,93,108,.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(96,156,255,.08); border-color: transparent; }
.btn-gift { background: linear-gradient(135deg,#ffb700,#ffd86b); color: #2a1a00; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(255,190,40,.7); }
.btn-block { width: 100%; }
.btn-sm { padding: .45em .8em; font-size: .88em; border-radius: 9px; }
.btn-icon { padding: .55em; border-radius: 10px; }
.btn .spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: .82em; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 12px; padding: .75em .9em; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { resize: vertical; min-height: 96px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,140,255,.22); }
.input::placeholder { color: #55648a; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237d8db0' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 2.6em; }
.input-wrap > svg.i { position: absolute; left: .9em; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-wrap .toggle-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-size: .85em; font-weight: 600; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: .7em .5em; cursor: pointer;
}
.seg button svg.i { width: 1.7em; height: 1.7em; }
.seg button.on { color: #fff; border-color: var(--primary); background: rgba(47,140,255,.16); box-shadow: inset 0 0 0 1px var(--primary); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: .85em; padding: .42em .85em; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; }
.chip.on { background: rgba(47,140,255,.18); border-color: var(--primary); color: #fff; }

.card { background: linear-gradient(180deg, rgba(17,26,51,.92), rgba(12,19,38,.92)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75em; font-weight: 700; padding: .25em .6em; border-radius: 999px; background: rgba(47,140,255,.16); color: #9cc6ff; border: 1px solid rgba(47,140,255,.3); white-space: nowrap; }
.badge.good { background: rgba(34,197,139,.14); color: #7fe6bf; border-color: rgba(34,197,139,.35); }
.badge.warn { background: rgba(244,179,61,.14); color: #ffd48a; border-color: rgba(244,179,61,.35); }
.badge.bad { background: rgba(255,93,108,.14); color: #ffacb4; border-color: rgba(255,93,108,.35); }
.badge.gift { background: rgba(255,204,77,.16); color: var(--gift); border-color: rgba(255,204,77,.4); }
.badge.memb { background: rgba(255,204,77,.14); color: var(--gift); border-color: rgba(255,204,77,.4); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg.i { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }

/* ─────────── Modal profesional ─────────── */
.ui-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(2,4,10,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s ease;
}
.ui-backdrop.out { animation: fadeOut .18s ease forwards; }
.ui-modal {
  width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #111b36 0%, #0a1124 100%);
  border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow), 0 0 80px -30px rgba(0,150,255,.6);
  animation: popIn .32s cubic-bezier(.2,.9,.3,1.25); overflow: hidden; position: relative;
}
.ui-modal.md { max-width: 620px; }
.ui-modal.lg { max-width: 860px; }
.ui-backdrop.out .ui-modal { animation: popOut .18s ease forwards; }
.ui-modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 6px; }
.ui-modal-head h3 { font-size: 1.2em; }
.ui-modal-head p { margin: 2px 0 0; color: var(--muted); font-size: .9em; }
.ui-modal-head .ui-x { margin-left: auto; margin-top: -4px; margin-right: -8px; }
.ui-modal-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(47,140,255,.15); color: #7fb6ff; border: 1px solid rgba(47,140,255,.3); }
.ui-modal-icon svg.i { width: 22px; height: 22px; }
.ui-modal-icon.danger { background: rgba(255,93,108,.14); color: #ff8b96; border-color: rgba(255,93,108,.35); }
.ui-modal-icon.good { background: rgba(34,197,139,.14); color: #6fe3b6; border-color: rgba(34,197,139,.35); }
.ui-modal-icon.gift { background: rgba(255,204,77,.15); color: var(--gift); border-color: rgba(255,204,77,.4); }
.ui-modal-body { padding: 12px 22px 8px; overflow: auto; color: var(--text-2); }
.ui-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; flex-wrap: wrap; }
.ui-modal-foot .btn { min-width: 110px; }
@media (max-width: 520px) {
  .ui-backdrop { align-items: flex-end; padding: 0; }
  .ui-modal { max-width: none !important; border-radius: 24px 24px 0 0; max-height: 94dvh; animation: sheetIn .32s cubic-bezier(.2,.9,.3,1); }
  .ui-backdrop.out .ui-modal { animation: sheetOut .2s ease forwards; }
  .ui-modal-foot .btn { flex: 1; }
}

/* Notificación de cliente (modal de marca) */
.notif-shell .ui-modal-body { padding: 0; }
.notif-modal { text-align: center; position: relative; }
.notif-hero { position: relative; padding: 30px 22px 10px; overflow: hidden; }
.notif-hero::before { content: ''; position: absolute; inset: -40% -20% auto; height: 240px; background: radial-gradient(closest-side, var(--nc, rgba(47,140,255,.45)), transparent); filter: blur(10px); }
.notif-logo { position: relative; width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.15); box-shadow: 0 0 0 6px rgba(47,140,255,.12), 0 10px 30px -5px rgba(0,140,255,.6); }
.notif-tag { position: relative; display: inline-flex; margin: 14px auto 0; }
.notif-hero h3 { position: relative; font-size: 1.45em; margin-top: 10px; color: #fff; }
.notif-body { padding: 4px 26px 6px; color: var(--text-2); font-size: 1.02em; white-space: pre-line; }
.notif-date { font-size: .78em; color: var(--muted); margin-top: 12px; }
.notif-count { position: absolute; top: 14px; right: 16px; font-size: .75em; color: var(--muted); z-index: 2; }
.notif-modal.premio { --nc: rgba(255,190,40,.5); }
.notif-modal.aviso { --nc: rgba(244,120,61,.45); }
.notif-modal.promo { --nc: rgba(0,198,255,.45); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.4s ease-in forwards; opacity: .9; }
@keyframes fall { to { transform: translateY(520px) rotate(720deg); opacity: 0; } }

/* Toasts */
.ui-toasts { position: fixed; z-index: 1100; left: 50%; transform: translateX(-50%); top: max(14px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.ui-toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(17,27,54,.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); pointer-events: auto; font-weight: 500; }
.ui-toast.good svg.i { color: var(--good); } .ui-toast.bad svg.i { color: var(--bad); } .ui-toast.info svg.i { color: var(--primary-2); }
.ui-toast.out { animation: fadeOut .25s ease forwards; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes popOut { to { opacity: 0; transform: scale(.96); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
