/* =========================================
componentes.css — UI (botones, cards, forms, calendario, etc.)
========================================= */

/* Botones */
.btn {
    --bg: rgba(255,255,255,.08);
    --bd: rgba(255,255,255,.14);
    --fg: var(--blanco);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .7em 1.05em;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: var(--bg);
    color: var(--fg);
    text-decoration: none;
    transition: transform var(--t), box-shadow var(--t), filter var(--t);
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: bold;
}
.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    background: white;
    color: #ce2c2b;
}
.btn:active{ transform: translateY(0); }

.btn--primario{ --bg: linear-gradient(180deg,var(--rojo),#C62828); --bd: transparent; box-shadow: var(--shadow-1); }
.btn--primario:hover{ filter: brightness(1.06); box-shadow: 0 14px 32px rgba(229,57,53,.45); color: white; background: #ce2c2b; }

.btn--fantasma{ --bg: transparent; --bd: rgba(255,255,255,.24); }
.btn--ghost{ --bg: rgba(255,255,255,.05); --bd: rgba(255,255,255,.08); }

.badge{
  display:inline-block; min-width:22px; padding:.15em .45em; border-radius:999px;
  font-size:.82em; text-align:center; border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}
.badge--verde{ background: rgba(76,175,80,.25); border-color: rgba(76,175,80,.45); }
.badge--rojo{  background: rgba(229,57,53,.25); border-color: rgba(229,57,53,.45); }

/* Tarjetas / grids */
.card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: clamp(12px, 2.4vw, 18px);
  box-shadow: var(--shadow-1);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  transform: translateZ(0);
  will-change: transform;
}
.card:hover,
.card:focus-within {
  transform: scale(1.03);
  box-shadow: var(--shadow-2);
  border-color: rgba(255,255,255,.12);
}
.card:active { transform: scale(1.01); }
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover, .card:focus-within, .card:active { transform: none; }
}
.card__titulo{ margin:0 0 6px; }

.grid-3{
  display:grid; gap: var(--g);
  grid-template-columns: repeat( auto-fit, minmax(min(240px, 100%), 1fr) );
  margin-top: 2rem;
}
@media (max-width: 767px){
  .grid-3 {
    grid-template-columns: 1fr; /* una columna en móviles */
    gap: clamp(12px, 3vw, 18px);
  }
}
@media (min-width: 768px) and (max-width: 1023px){
  .grid-3 {
    grid-template-columns: repeat(2, 1fr); /* dos columnas en tablet */
  }
}

/* Formularios */
.form-grid{
  display:grid; gap: 12px;
  grid-template-columns: repeat( auto-fit, minmax(min(240px, 100%), 1fr) );
}
@media (max-width: 767px){
  .form-grid {
    grid-template-columns: 1fr; /* una columna en móviles */
  }
}
.campo{ display:grid; gap:6px; }
.campo__label{ font-size:.95em; opacity:.85; }
.campo__input{
  appearance:none; width:100%;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.16);
  color:var(--blanco); padding:12px 12px;
  border-radius:12px;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.campo__input::placeholder{ color: rgba(255,255,255,.55); }
.campo__input:focus{ border-color: rgba(255,255,255,.34); box-shadow: 0 0 0 3px rgba(229,57,53,.25); }

.feedback{
  padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04); margin-top:8px;
}
.feedback--ok{ border-color: rgba(76,175,80,.5); background: rgba(76,175,80,.18); }
.feedback--err{ border-color: rgba(229,57,53,.5); background: rgba(229,57,53,.18); }

.small{ font-size:.9em; opacity:.9; }
.center{ text-align:center; }

/* Estética vidrio adicional */
.vidrio {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    border-radius: var(--radius-lg);
}

/* Calendario */
.cal-wrap {
    overflow: hidden;
    border-radius: var(--radius);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    background: #1010104d;
    margin-top: 2rem;
}
.cal{
  display:grid; gap: clamp(4px, 1vw, 8px); padding: clamp(8px, 2vw, 16px);
  grid-template-columns: repeat(7, 1fr);
}
.cal .cab{ text-align:center; font-size: clamp(.8em, 2vw, .9em); opacity:.75; padding:4px 0; }
.cal .vacia{ visibility:hidden; }
@media (max-width: 480px){
  .cal {
    gap: 4px;
    padding: 8px;
  }
  .cal .cab {
    font-size: .75em;
  }
}

.dia{
  position:relative; display:grid; place-items:center; gap: clamp(4px, 1vw, 8px); 
  padding: clamp(8px, 2vw, 14px) clamp(6px, 1.5vw, 10px);
  border-radius:12px; border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03); color:var(--blanco);
  transition: transform var(--t), filter var(--t), background var(--t);
  min-height: clamp(48px, 12vw, 64px);
}
.dia:hover{ transform: translateY(-7.5px); }
.dia[aria-disabled="true"]{ opacity:.5; filter:grayscale(.5); cursor:not-allowed; }
.dia__numero{ font-weight:700; font-size: clamp(1em, 2.5vw, 1.1em); }
@media (max-width: 480px){
  .dia {
    padding: 8px 4px;
    min-height: 44px;
  }
  .dia:hover {
    transform: translateY(-3px); /* menos movimiento en móvil */
  }
}
.dia--verde{ background: linear-gradient(180deg, rgba(76,175,80,.12), rgba(255,255,255,.02)); }
.dia--rojo{  background: linear-gradient(180deg, rgba(229,57,53,.12), rgba(255,255,255,.02)); }

/* Selector de horas */
.horas__lista{ 
  display:grid; 
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: clamp(8px, 2vw, 12px); 
}
@media (max-width: 480px){
  .horas__lista {
    grid-template-columns: repeat(2, 1fr);
  }
}
.hora{
  border-radius:999px; 
  padding: clamp(.5em, 1.5vw, .7em) clamp(.75em, 2vw, 1em); 
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04); color:var(--blanco);
  transition: transform var(--t), box-shadow var(--t), background var(--t);
  font-size: clamp(14px, 2vw, 16px);
  text-align: center;
}
.hora:hover{ transform: translateY(-1px); box-shadow: var(--shadow-1); }
.hora[aria-pressed="true"]{ 
  background: rgba(255,212,0,.18); 
  border-color: rgba(255,212,0,.5); 
  box-shadow: 0 0 0 3px rgba(255,212,0,.18); 
}

/* === Check centrado, nítido y con animación suave === */
.check-wrap {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 12px 0;
}
.check {
  --s: 96px;
  --ok-grad: linear-gradient(135deg, #16a34a, #22c55e);
  --ok-ring: rgba(34,197,94,.35);
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--ok-grad);
  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    inset 0 0 0 12px rgba(255,255,255,.08);
  transform: scale(.85);
  opacity: 0;
  animation: check-in 900ms cubic-bezier(.2,.9,.25,1) forwards 120ms;
}
.check::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 58% 58%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23fff' stroke-width='10' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 52 L42 72 L78 36'/%3E%3C/svg%3E");
  transform: scale(.8);
  opacity: 0;
  animation: check-tick 850ms cubic-bezier(.3,.9,.3,1) forwards 300ms;
}
.check::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--ok-ring);
  filter: blur(8px);
  opacity: 0;
  transform: scale(.65);
  animation: check-ring 1400ms ease-out forwards 220ms;
}
.check-wrap + .modal-text,
.check-wrap + p { margin-top: 12px; }
@media (max-width: 480px) { .check { --s: 78px; } }
@media (prefers-reduced-motion: reduce) {
  .check, .check::before, .check::after { animation: none !important; opacity: 1 !important; transform: none !important; }
}
@media (max-width: 480px) {
  .check { width: 72px; height: 72px; }
  .check::after {
    border-right-width: 5px;
    border-bottom-width: 5px;
    height: 28px;
    transform: translate(-14px, -6px) rotate(45deg) scaleX(0) scaleY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .check, .check::before, .check::after { animation: none !important; }
  .check { opacity: 1; transform: none; }
}

/* Cabecera calendario interior */
.cabecera-cal{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; flex-wrap:wrap;
}
@media (max-width: 480px){
  .cabecera-cal {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
.cal-mes{
  margin-left:auto;
  padding:.3em .7em;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  font-weight:600;
  opacity:.9;
}

/* Utilidades */
.badge--rojo strong, .badge--verde strong{ font-weight:700; }

/* ====== FIX de seguridad para [hidden] ====== */
[hidden] { display: none !important; }

/* ====== Header/Nav/Hamburguesa ====== */
.cabecera {
  position: sticky; top: 0; z-index: 1000;
  background: radial-gradient(1200px 600px at 75% -10%, rgba(229, 57, 53, .35), transparent 60%), radial-gradient(900px 500px at -10% 30%, rgba(255, 212, 0, .08), transparent 55%), linear-gradient(180deg, #0b0b0b82, #121212bd);
}
.cabecera__contenedor {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px clamp(12px, 2vw, 24px);
}
.nav { display: flex; align-items: center; gap: clamp(10px,2vw,20px); }

/* Botones del header (links + botones) */
.nav__link,
.menu-movil__link,
.menu-movil__cta,
.nav__cta {
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 14px; min-height: 40px;
  border-radius: 999px; line-height:1;
  border: 1px solid white;
  color:#fff; background: transparent;
  text-decoration: none; cursor: pointer;
  font-size: clamp(14px, 1.6vw, 16px);
  transition:
    transform .12s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    opacity .18s ease;
}
.nav__cta {
  background: #e9142e; border-color: #e9142e; color:#fff;
}
.nav__link:hover,
.menu-movil__link:hover,
.menu-movil__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(233,20,46,.25);
  border-color: rgba(255,255,255,.32);
}
.nav__cta:hover {
    filter: brightness(1.05);
    color: #c92a29;
    background: white;
    border-radius: 10px;
}

/* ====== Modal & horas (espaciado + identidad) ====== */
.modal .modal-header { display:flex; align-items:center; gap:12px; margin-bottom:2REM; }
.modal .modal-title { font-size: clamp(18px,2.2vw,30px); color: #dd3432; }
.modal .modal__acciones { display:flex; gap:10px; margin-top:1rem; flex-wrap:wrap; }
.horas__lista {
  display:grid; gap:10px; margin-top:8px; margin-bottom: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
}
#res-dia { color: yellow; font-weight: 200; }
#res-dia-2 { color: yellow; font-weight: 200; }
#res-hora-2 { color: yellow; font-weight: 200; }
.modal-text { margin-bottom: 2rem; }
.hora {
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  border-radius:12px; cursor:pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.hora:hover { transform: translateY(-1px); }
.hora[aria-pressed="true"]{
  background:#e9142e; border-color:#e9142e; color:#fff;
  box-shadow: 0 6px 18px rgba(233,20,46,.35);
}

.feedback { border-radius:12px; padding:10px 14px; margin-top:8px; }

/* ====== VISOR DE CONTRASEÑA (ojo) ====== */
.campo { position: relative; }
.campo.has-pw-toggle .campo__input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #ddd;
  cursor: pointer;
  padding: 0;
}
.pw-toggle:hover { color: #fff; }
.pw-toggle:focus { outline: 2px solid rgba(255,255,255,.35); outline-offset: 2px; border-radius: 8px; }
.pw-toggle svg { width: 22px; height: 22px; display: block; }
.pw-toggle .icon-eye-off { display: none; }
.campo.campo--pw-visible .pw-toggle .icon-eye { display: none; }
.campo.campo--pw-visible .pw-toggle .icon-eye-off { display: inline; }
@media (prefers-reduced-motion: reduce){ .pw-toggle { transition: none; } }
/* ====== /FIN VISOR DE CONTRASEÑA ====== */

/* ====== CLASES UTILITARIAS PARA ESTILOS INLINE ====== */

/* Logo del menú móvil */
.menu-movil .logo {
  width: 60%;
  border: solid 4px var(--ki, #ffd400);
  border-radius: 999px;
}

/* Texto con color ki */
.text-ki {
  color: var(--ki, #ffd400);
}

/* Texto blanco */
.text-white {
  color: #fff;
}

/* Texto amarillo */
.text-yellow {
  color: #ffd400;
}

/* Día verde en calendario */
.dia-verde-text {
  background: linear-gradient(180deg, rgba(76, 175, 80, .12), rgba(255, 255, 255, .02));
  padding: 2px 4px;
  border-radius: 4px;
}

/* Contenedor con max-width */
.contenedor-narrow {
  max-width: 640px;
}

/* Modal de cancelar */
.modal-cancelar {
  padding: clamp(30px, 5vw, 40px) clamp(24px, 4vw, 30px);
  text-align: left;
}

.modal-cancelar .modal-header h3 {
  margin: 8px 0 0;
}

.modal-cancelar .modal-text {
  color: #d0d0d0;
  margin: 10px 0 16px;
}

.acciones {
  display: flex;
  gap: clamp(12px, 3vw, 15px);
  margin-top: 2rem;
  flex-wrap: wrap;
}
@media (max-width: 480px){
  .acciones {
    flex-direction: column;
  }
  .acciones .btn {
    width: 100%;
  }
}

/* Form grid con margin bottom */
.form-grid--spaced {
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

/* Logo en modal login */
.modal-header .logo {
  border-radius: 12px;
}

/* Pie de página */
.pie small {
  color: var(--ki, #ffd400);
}
.pie b {
  color: white;
}
.pie__links {
  display: none;
}
.pie__links a {
  color: var(--ki, #ffd400);
}

/* Sección con margin 0 */
.seccion__titulo--no-margin {
  margin: 0;
}

/* Título calendario (blanco) */
.seccion__titulo--white {
  color: white;
  font-size: clamp(22px, 3.5vw, 49px);
}

/* Modal acciones sin margin-top */
.modal__acciones--compact {
  margin-top: 0;
}

/* ====== FIN CLASES UTILITARIAS ====== */