/* Trazo · sistema de diseño base */
:root {
  --ink: #0E1525;
  --ink-2: #3A4458;
  --ink-3: #6B7488;
  --ink-4: #98A0B3;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F3F8;
  --surface-3: #E8EBF2;
  --line: #E3E6EE;
  --line-2: #D3D8E3;
  --brand: #2F5BFF;
  --brand-600: #2449E0;
  --brand-50: #EEF2FF;
  --brand-100: #DDE5FF;
  --violet: #6F4BFF;
  --amber: #FFB020;
  --amber-600: #E08E00;
  --green: #12A150;
  --green-50: #E7F7EE;
  --red: #E5484D;
  --red-50: #FDECEC;
  --amber-50: #FFF5E0;
  --violet-50: #F1EDFF;
  --gray-50: #F1F3F8;
  --grad: linear-gradient(120deg, #2F5BFF 0%, #6F4BFF 50%, #FFB020 100%);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14, 21, 37, .06);
  --shadow: 0 1px 2px rgba(14, 21, 37, .05), 0 6px 20px -6px rgba(14, 21, 37, .10);
  --shadow-lg: 0 2px 4px rgba(14, 21, 37, .04), 0 24px 60px -18px rgba(14, 21, 37, .28);
  --focus: 0 0 0 3px rgba(47, 91, 255, .28);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #EEF1F8;
  --ink-2: #C4CADA;
  --ink-3: #8E97AD;
  --ink-4: #646D83;
  --bg: #0A0F1C;
  --surface: #111827;
  --surface-2: #161F31;
  --surface-3: #1D283D;
  --line: #222D43;
  --line-2: #2E3A54;
  --brand: #5B7CFF;
  --brand-600: #7390FF;
  --brand-50: #172246;
  --brand-100: #1E2C5C;
  --green-50: #0F2A1E;
  --red-50: #2E1518;
  --amber-50: #2C2210;
  --violet-50: #1F1A3D;
  --gray-50: #1A2335;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01', 'tnum' 0;
}
img, svg { display: block; max-width: 100%; }
svg.i { display: inline-block; flex-shrink: 0; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Botones */
.btn {
  --b: var(--surface); --c: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bd);
  background: var(--b); color: var(--c); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { --b: var(--brand); --c: #fff; --bd: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 16px -6px rgba(47, 91, 255, .6); }
.btn-primary:hover { background: var(--brand-600); }
.btn-dark { --b: #0E1525; --c: #fff; --bd: transparent; }
.btn-dark:hover { background: #1B2438; }
.btn-ghost { --b: transparent; --bd: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { --c: var(--red); }
.btn-green { --b: var(--green); --c: #fff; --bd: transparent; }
.btn-green:hover { background: #0E8A44; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7488' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input.invalid { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--gray-50); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.blue { background: var(--brand-50); color: var(--brand); }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: var(--amber-600); }
.badge.violet { background: var(--violet-50); color: var(--violet); }
.badge.gray { background: var(--gray-50); color: var(--ink-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.score {
  --c: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12px;
  height: 22px; padding: 0 8px 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c);
}
.score.hot { --c: #E5484D; }
.score.warm { --c: #E08E00; }
.score.cold { --c: #3E7BFA; }

.stars { display: inline-flex; gap: 1px; color: var(--amber); }
.stars svg { fill: currentColor; }
.stars .off { color: var(--line-2); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0E1525; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: center; animation: toastIn .25s ease; pointer-events: auto; }
.toast.error { background: #B4232A; }
.toast.ok svg { color: #4ADE80; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
