:root {
  /* Fondo con gradiente aurora */
  --bg-color: #0a0e14;
  --bg-base-1: #0a0e14;
  --bg-base-2: #0f1620;
  --text-primary: #f0f4f8;
  --text-secondary: #8b9bb0;
  --shadow-dark: rgba(0,0,0,0.65);
  --shadow-light: rgba(255,255,255,0.05);
  --glass-bg: rgba(255,255,255,0.045);
  --glass-bg-hover: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.09);
  --glass-border-hover: rgba(0,245,212,0.35);
  --glass-highlight: rgba(255,255,255,0.10);
  --accent-aqua: #00f5d4;
  --accent-green: #00f59b;
  --accent-yellow: #ffd93d;
  --accent-coral: #ff5470;
  --accent-blue: #4cc9f0;
  --gradient-accent: linear-gradient(135deg, #00f5d4 0%, #00f59b 50%, #4cc9f0 100%);
  --gradient-warm: linear-gradient(135deg, #ffd93d 0%, #ff8a4c 100%);
  --gradient-danger: linear-gradient(135deg, #ff5470 0%, #ff7b54 100%);
}
html.light {
  --bg-color: #eef3fa;
  --bg-base-1: #eef3fa;
  --bg-base-2: #dde6f2;
  --text-primary: #0f172a;
  --text-secondary: #5b6b80;
  --shadow-dark: rgba(148,163,184,0.35);
  --shadow-light: rgba(255,255,255,0.95);
  --glass-bg: rgba(255,255,255,0.6);
  --glass-bg-hover: rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.8);
  --glass-border-hover: rgba(0,200,180,0.5);
  --glass-highlight: rgba(255,255,255,1);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: background .4s, color .4s;
  user-select: none;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== AURORA BLUR BLOBS ===== */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  transition: opacity .4s;
}
body::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #00f5d4, transparent 70%);
  top: -180px; left: -120px;
  animation: float-blob 18s ease-in-out infinite;
}
body::after {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #ffd93d, transparent 70%);
  bottom: -200px; right: -150px;
  animation: float-blob 22s ease-in-out infinite reverse;
}
html.light body::before { opacity: 0.22; }
html.light body::after  { opacity: 0.20; }

@keyframes float-blob {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-30px) scale(1.08); }
  66%     { transform: translate(-30px,40px) scale(0.95); }
}

/* Asegura que el contenido esté encima de los blobs */
body > * { position: relative; z-index: 1; }

/* ===== GLASS CARDS ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  box-shadow:
    0 10px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 var(--glass-highlight);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}
.glass:hover { border-color: var(--glass-border-hover); }

.glass-sm {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  box-shadow:
    0 4px 18px rgba(0,0,0,0.2),
    inset 0 1px 0 var(--glass-highlight);
  transition: all .2s ease;
}
.glass-sm:hover { background: var(--glass-bg-hover); }

/* ===== INSET ===== */
.neu-inset {
  background: rgba(0,0,0,0.25);
  box-shadow:
    inset 2px 2px 6px rgba(0,0,0,0.5),
    inset -1px -1px 3px rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.04);
}
html.light .neu-inset {
  background: rgba(255,255,255,0.5);
  box-shadow:
    inset 2px 2px 5px rgba(163,177,198,0.4),
    inset -1px -1px 3px rgba(255,255,255,0.9);
}

/* ===== BOTONES ===== */
.btn-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.btn-glass:hover {
  transform: translateY(-1px);
  border-color: rgba(0,245,212,0.5);
  box-shadow: 0 8px 24px rgba(0,245,212,0.18);
  background: linear-gradient(135deg, rgba(0,245,212,0.12), rgba(255,255,255,0.03));
}
.btn-glass:active { transform: scale(.97); }

.btn-accent {
  background: var(--gradient-accent);
  color: #04121a;
  font-weight: 800;
  border: none;
  box-shadow:
    0 8px 28px rgba(0,245,212,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.btn-accent::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%);
  transition: transform .6s;
}
.btn-accent:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 36px rgba(0,245,212,0.55);
  transform: translateY(-1px);
}
.btn-accent:hover::after { transform: translateX(100%); }
.btn-accent:active { transform: scale(.97); }

/* ===== DÍAS CALENDARIO ===== */
.day-cell {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 1rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 0.4rem;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.day-cell:hover {
  transform: scale(1.06);
  border-color: rgba(0,245,212,0.45);
  box-shadow: 0 6px 20px rgba(0,245,212,0.2);
}
.day-cell.selected {
  border-color: var(--accent-aqua);
  background: linear-gradient(135deg, rgba(0,245,212,0.15), rgba(76,201,240,0.08));
  box-shadow:
    0 0 20px rgba(0,245,212,0.4),
    inset 0 0 12px rgba(0,245,212,0.1);
}
.day-cell.blocked {
  background: linear-gradient(135deg, rgba(255,84,112,0.12), rgba(255,123,84,0.06));
  border-color: rgba(255,84,112,0.4);
}
.day-cell.blocked .day-num { text-decoration: line-through; opacity: .4; }
.day-cell.today .day-num::after {
  content: '';
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-aqua);
  box-shadow: 0 0 6px var(--accent-aqua);
}
.day-num { font-size: .82rem; font-weight: 800; position: relative; letter-spacing: -.02em; }
.day-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  transition: all .2s;
}
.day-dot.blocked-dot {
  background: var(--accent-coral);
  box-shadow: 0 0 8px var(--accent-coral);
}
.day-dot.has-appts {
  background: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}
.appt-count {
  position: absolute; top: 3px; right: 3px;
  background: var(--gradient-warm); color: #0a0e14;
  font-size: 9px; font-weight: 900;
  width: 15px; height: 15px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,138,76,0.4);
}

/* ===== LOCK BUTTON ===== */
.lock-btn.active {
  background: var(--gradient-danger);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 28px rgba(255,84,112,0.6);
  animation: pulse-lock 1.6s infinite;
}
@keyframes pulse-lock {
  0%,100% { box-shadow: 0 0 18px rgba(255,84,112,0.4); }
  50%     { box-shadow: 0 0 32px rgba(255,84,112,0.85); }
}

/* ===== SWITCH ===== */
.switch-track {
  width: 46px; height: 26px; border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--glass-border);
  position: relative; cursor: pointer; transition: all .3s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #64748b, #334155);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.switch-track.switch-on { background: rgba(0,245,155,0.2); border-color: rgba(0,245,155,0.4); }
.switch-track.switch-on .switch-thumb {
  left: 22px;
  background: var(--gradient-accent);
  box-shadow: 0 0 12px var(--accent-green);
}
.switch-track.switch-off { background: rgba(255,84,112,0.2); border-color: rgba(255,84,112,0.4); }
.switch-track.switch-off .switch-thumb {
  background: var(--gradient-danger);
  box-shadow: 0 0 12px var(--accent-coral);
}

/* ===== NOTIF ===== */
.notif-dot {
  position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 10px var(--accent-coral);
  animation: pulse-dot 1.2s infinite;
}
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.4); opacity: .6; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-aqua), var(--accent-blue));
  border-radius: 999px;
  opacity: 0.5;
}

/* ===== TOAST ===== */
#toast {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade { animation: fadeIn .3s cubic-bezier(.4,0,.2,1); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-pop { animation: slideUp .28s cubic-bezier(.4,0,.2,1); }

/* ===== INPUTS FOCUS ===== */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-aqua) !important;
  box-shadow: 0 0 0 3px rgba(0,245,212,0.15);
}

/* ===== HOVER MICRO ===== */
.glass, .glass-sm, .btn-glass {
  will-change: transform;
}

/* ===== TABS ACTIVOS ===== */
.tab-active-glow {
  box-shadow:
    0 0 20px rgba(0,245,212,0.25),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ===== SLOT BOTONES ===== */
.slot-btn {
  position: relative;
  overflow: hidden;
}
.slot-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(0,245,212,0.15), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
}
.slot-btn:hover::before { opacity: 1; }

/* ===== BADGE SELECCIÓN CARRITO ===== */
.cart-badge {
  background: var(--gradient-accent);
  color: #04121a;
  box-shadow: 0 2px 10px rgba(0,245,212,0.5);
  animation: pop-in .3s cubic-bezier(.4,0,.2,1);
}
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===== SOMBRA SUAVE PARA CARDS CON BORDE LATERAL ===== */
.card-appt-confirmed {
  border-left: 4px solid var(--accent-green);
  background: linear-gradient(90deg, rgba(0,245,155,0.06), transparent 40%);
}
.card-appt-pending {
  border-left: 4px solid var(--accent-yellow);
  background: linear-gradient(90deg, rgba(255,217,61,0.06), transparent 40%);
}

/* ===== RESPONSIVE AJUSTES ===== */
@media (max-width: 640px) {
  .glass { border-radius: 1.25rem; }
  .day-num { font-size: .75rem; }
}