/* Bonos Apple · sistema de diseño base (tokens, vidrio, botones, formularios, ventanas, avisos) */
:root {
  --ink: #0e1a45;
  --ink-2: #4a5380;
  --ink-3: #868cad;
  --bg: #f4f2ff;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(116, 104, 224, 0.18);
  --pink: #ff6fa5;
  --violet: #8f6bff;
  --blue: #4f8bff;
  --mint: #19b97f;
  --mint-soft: #dcf7ec;
  --amber: #f5a524;
  --amber-soft: #ffeccb;
  --red: #ec4f6e;
  --red-soft: #ffe1e8;
  --grad: linear-gradient(100deg, #ff6fa5 0%, #a56bff 52%, #4f8bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 111, 165, 0.16), rgba(143, 107, 255, 0.16) 55%, rgba(79, 139, 255, 0.16));
  --shadow-lg: 0 34px 70px -34px rgba(78, 64, 170, 0.5);
  --shadow-md: 0 16px 38px -22px rgba(78, 64, 170, 0.45);
  --shadow-sm: 0 8px 20px -14px rgba(78, 64, 170, 0.4);
  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Fondo iridiscente fijo */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, #f6f4ff 0%, #fdf1f8 55%, #eef6ff 100%); }
.bg-orbs::before, .bg-orbs::after, .bg-orbs i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.85;
}
.bg-orbs::before { width: 62vmax; height: 62vmax; left: -22vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, #cfc9ff, rgba(207, 201, 255, 0) 68%); }
.bg-orbs::after { width: 56vmax; height: 56vmax; right: -20vmax; top: 6vmax; background: radial-gradient(circle at 50% 50%, #ffd0e4, rgba(255, 208, 228, 0) 68%); }
.bg-orbs i { width: 60vmax; height: 60vmax; left: 10vmax; bottom: -30vmax; background: radial-gradient(circle at 50% 50%, #c6e2ff, rgba(198, 226, 255, 0) 68%); }

h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }

:focus-visible { outline: 3px solid rgba(143, 107, 255, 0.55); outline-offset: 2px; border-radius: 10px; }

/* Vidrio */
.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  backdrop-filter: blur(16px) saturate(1.35);
  border-radius: var(--r-lg);
}
.glass-strong { background: var(--glass-strong); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 24px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 15px/1.1 var(--font); letter-spacing: 0.01em; text-decoration: none; white-space: nowrap;
  color: var(--ink); background: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn[disabled], .btn.is-disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: grayscale(0.2); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 14px 30px -12px rgba(143, 107, 255, 0.85); }
.btn-primary:hover { filter: brightness(1.05) saturate(1.05); }
.btn-wa { color: #fff; background: linear-gradient(135deg, #2fd57b, #12a35a); box-shadow: 0 14px 30px -14px rgba(18, 163, 90, 0.8); }
.btn-ghost { background: rgba(255, 255, 255, 0.7); border: 1.5px solid var(--line); box-shadow: none; }
.btn-danger { color: #fff; background: linear-gradient(135deg, #f5688a, #d93a5f); box-shadow: 0 12px 26px -14px rgba(217, 58, 95, 0.8); }
.btn-soft { background: var(--grad-soft); box-shadow: none; color: #5b3fd0; }
.btn-sm { padding: 9px 15px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: 50%; }

/* Formularios */
.field { display: block; margin-bottom: 14px; }
.field > span, .label {
  display: block; margin: 0 0 6px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.input, .select, .textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.85); color: var(--ink); font: 600 16px var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 84px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #a7acc6; font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #a58bff; box-shadow: 0 0 0 4px rgba(143, 107, 255, 0.18); }
.field-error { margin: 6px 0 0 4px; font-size: 13px; font-weight: 600; color: var(--red); }
.form-error { display: none; margin: 4px 0 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--red-soft); color: #b3243f; font-size: 14px; font-weight: 600; }
.form-error.is-on { display: block; }
.trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Interruptor */
.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d6d9ec; transition: background 0.2s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(20, 20, 60, 0.3); transition: transform 0.2s ease; }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid rgba(143, 107, 255, 0.55); outline-offset: 2px; }

/* Etiquetas */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.03em; }
.pill-green { background: var(--mint-soft); color: #0c7d55; }
.pill-amber { background: var(--amber-soft); color: #946000; }
.pill-red { background: var(--red-soft); color: #b3243f; }
.pill-gray { background: #e9e9f5; color: #666b91; }
.pill-violet { background: #ece6ff; color: #5b3fd0; }

/* Ventanas */
.modal-veil {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(22, 18, 64, 0.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: veil-in 0.18s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 24px 20px 28px;
  background: rgba(255, 255, 255, 0.96); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  animation: sheet-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { font-size: 22px; font-weight: 800; }
.modal-x { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: #eeeaff; color: #5b3fd0; font-size: 18px; cursor: pointer; }
@media (min-width: 720px) {
  .modal-veil { align-items: center; padding: 20px; }
  .modal { border-radius: 28px; }
}
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Avisos */
#toasts { position: fixed; z-index: 200; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast {
  pointer-events: auto; max-width: 440px; padding: 12px 18px; border-radius: 16px; font-size: 14.5px; font-weight: 700;
  color: #fff; background: rgba(20, 24, 70, 0.92); box-shadow: var(--shadow-md); animation: toast-in 0.2s ease;
}
.toast.ok { background: linear-gradient(135deg, #17a46f, #0f8a5c); }
.toast.err { background: linear-gradient(135deg, #e94a6c, #c8334f); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Cargando */
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.spin-dark { border-color: rgba(91, 63, 208, 0.2); border-top-color: #5b3fd0; }
@keyframes spin { to { transform: rotate(360deg); } }
