/* Dr. José Tuquerrez — sistema de diseño compartido (sitio, app, panel) */
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@property --p { syntax: '<number>'; initial-value: 0; inherits: false; }
:root {
  --ink: #050507; --ink2: #0d0d12; --ink3: #15161f; --ink4: #212337;
  --pearl: #f4f4f7; --pearl2: #d3d4de; --mute: #9a9cae; --mute2: #6c6f82;
  --aqua: #aab5e0; --aqua2: #7782af; --aqua3: #424c78; --glow: rgba(166,176,224, .55);
  --champ: #dcdee8; --champ2: #8f93ab;
  --ok: #4be3a6; --warn: #ffc261; --bad: #ff6b81;
  --line: rgba(196,200,224, .13); --line2: rgba(196,200,224, .26);
  --glass: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.02));
  --r: 22px;
  --f-d: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --f-b: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --f-m: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--pearl); font-family: var(--f-b); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--aqua); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
.serif { font-family: var(--f-d); }
.mono { font-family: var(--f-m); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- botones con profundidad ---------- */
.btn {
  --h: 54px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  height: var(--h); padding: 0 1.7rem; border-radius: 999px; font-weight: 700; letter-spacing: .02em; font-size: .95rem;
  color: #0b0d18; isolation: isolate; overflow: hidden; white-space: nowrap;
  background: linear-gradient(180deg, #e6e9fa 0%, var(--aqua) 38%, var(--aqua2) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.85), inset 0 -3px 6px rgba(30,36,70, .45), 0 1px 0 rgba(255,255,255,.2),
    0 10px 22px -6px rgba(112,124,172, .65), 0 28px 48px -18px rgba(166,176,224, .5);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), filter .3s;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn:hover { transform: translateY(-3px) scale(1.02); filter: saturate(1.15); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 -3px 6px rgba(30,36,70,.45), 0 16px 30px -8px rgba(112,124,172,.8), 0 40px 70px -20px rgba(166,176,224,.7); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(1px) scale(.985); box-shadow: inset 0 3px 8px rgba(26,31,62,.55), 0 4px 10px -4px rgba(112,124,172,.6); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm { --h: 42px; padding: 0 1.15rem; font-size: .84rem; }
.btn.lg { --h: 62px; padding: 0 2.2rem; font-size: 1.02rem; }
.btn.ghost {
  color: var(--pearl); background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -2px 6px rgba(0,0,0,.35), 0 12px 30px -12px rgba(0,0,0,.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn.ghost::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--a), transparent 0 60%, var(--aqua) 80%, #fff 90%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 4.5s linear infinite; z-index: 1; pointer-events: none; }
.btn.ghost:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 16px 40px -10px rgba(166,176,224,.45); }
.btn.dark { color: var(--pearl); background: linear-gradient(180deg, #2a2d45, #171926); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -3px 6px rgba(0,0,0,.5), 0 10px 24px -8px rgba(0,0,0,.8); }
.btn.gold { color: #14151f; background: linear-gradient(180deg, #ffffff, var(--champ) 42%, var(--champ2)); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.9), inset 0 -3px 6px rgba(60,62,84,.45), 0 12px 26px -8px rgba(150,153,172,.6); }
@keyframes spin { to { --a: 360deg; } }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(166,176,224,.07); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--aqua); font-weight: 700; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 10px var(--aqua); animation: blink 1.8s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- vidrio ---------- */
.glass { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 30px 60px -30px rgba(0,0,0,.9); }
.glass.lit::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(166,176,224,.8), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: 0; transition: opacity .3s; }
.glass.lit:hover::before { opacity: 1; }

/* ---------- campos ---------- */
.fld { display: grid; gap: .4rem; }
.fld label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.in { width: 100%; height: 52px; padding: 0 1rem; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); outline: none; transition: border .2s, box-shadow .2s, background .2s; box-shadow: inset 0 2px 6px rgba(0,0,0,.35); }
textarea.in { height: auto; padding: .8rem 1rem; resize: vertical; }
.in:focus { border-color: var(--aqua); background: rgba(166,176,224,.05); box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 0 0 4px rgba(166,176,224,.14); }
.in::placeholder { color: var(--mute2); }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%239a9cae' stroke-width='2'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.4rem; }
select.in option { background: var(--ink2); }

.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); font-size: .86rem; font-weight: 600; transition: all .25s var(--ease); }
.chip:hover { border-color: var(--aqua); transform: translateY(-2px); }
.chip.on { background: linear-gradient(180deg, rgba(166,176,224,.3), rgba(166,176,224,.12)); border-color: var(--aqua); color: #fff; box-shadow: 0 0 22px -4px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }

/* ---------- utilidades ---------- */
.grain::after { content: ''; position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0,0); } }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: grid; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 360px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(160deg, rgba(33,35,54,.96), rgba(14,14,19,.96)); border: 1px solid var(--line2); box-shadow: 0 24px 50px -18px #000, 0 0 30px -10px var(--glow); display: flex; gap: 12px; align-items: flex-start; animation: toastIn .55s var(--ease) both; font-size: .9rem; }
.toast b { display: block; font-size: .92rem; }
.toast span { color: var(--mute); font-size: .82rem; }
.toast .ic { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(180deg, var(--aqua), var(--aqua2)); display: grid; place-items: center; flex: none; color: #0b0d18; }
.toast.out { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.95); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
