/* ============================================================
   Proyectos Bacanes — Agenda de reuniones
   Look: colores de marca dominantes, enérgico y pro (menos infantil).
   ============================================================ */
:root {
  /* Paleta de marca */
  --teal: #009ab4; /* Verde Hornet */
  --morado: #5333cc; /* Morado Pipe  */
  --morado-osc: #3f2ea8;
  --naranja: #ff7a00; /* Naranja Optimismo */
  --naranja-osc: #e86e00;
  --navy: #101828; /* Azul Pro */
  --blanco: #ffffff;

  --card: #ffffff;
  --text: var(--navy);
  --text-dim: #5b6472;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 42px rgba(8, 12, 34, 0.26);
  --shadow-sm: 0 8px 22px rgba(8, 12, 34, 0.16);

  /* Tipografías: Lacquer solo como firma (logo + título hero) */
  --font-display: "Lacquer", system-ui, sans-serif;
  --font-hand: "Just Me Again Down Here", cursive;
  --font-body: "Mona Sans", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--blanco);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  /* Fondo saturado de marca: morado → teal con brillo naranja */
  background:
    radial-gradient(1100px 720px at 88% 108%, rgba(255, 122, 0, 0.34), transparent 58%),
    radial-gradient(900px 640px at 6% -8%, rgba(83, 51, 204, 0.55), transparent 60%),
    radial-gradient(1000px 900px at 60% 50%, rgba(8, 12, 40, 0.18), transparent 70%),
    linear-gradient(148deg, #5333cc 0%, #3f2ea8 42%, #0a7f98 100%);
  background-attachment: fixed;
}
/* Brillo que deriva lento: riqueza sin recargar */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(0, 154, 180, 0.28), transparent 72%) 82% 20% / 52vmax 52vmax no-repeat,
    radial-gradient(closest-side, rgba(255, 122, 0, 0.16), transparent 72%) 58% 96% / 46vmax 46vmax no-repeat;
  filter: blur(30px);
  animation: derivar 22s ease-in-out infinite alternate;
}
@keyframes derivar {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -3%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.oculto {
  display: none !important;
}

/* --- Barra superior --- */
.topbar {
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--blanco);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--blanco);
}
.brand .logo {
  height: 46px;
  width: auto;
  display: block;
}
.topbar .fecha-pill {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  background: var(--naranja);
  color: var(--blanco);
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 56px 24px 10px;
  max-width: 860px;
  margin: 0 auto;
}
.hero .eyebrow {
  font-family: var(--font-hand);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.5rem;
  margin: 0 0 2px;
  transform: rotate(-1deg);
}
.hero h1 {
  font-family: var(--font-display);
  color: var(--blanco);
  font-size: clamp(2.6rem, 7.5vw, 4.4rem);
  line-height: 1.02;
  margin: 0 0 16px;
  text-transform: uppercase;
  text-shadow: 0 6px 24px rgba(8, 12, 34, 0.3);
}
.hero .subtitulo {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 auto 24px;
  max-width: 520px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: center;
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(16, 24, 40, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--blanco);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
}
.meta .ico {
  width: 17px;
  height: 17px;
  color: var(--naranja);
  flex-shrink: 0;
}

/* --- Layout --- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 24px 76px;
}

/* --- Leyenda --- */
.leyenda {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 10px 0 26px;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.leyenda span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}
.dot.libre {
  background: var(--naranja);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.28);
}
.dot.tomado {
  background: rgba(255, 255, 255, 0.4);
}

/* --- Grilla de slots --- */
.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 15px;
}
.cargando {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  padding: 48px 0;
}
.slot {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-height: 98px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(16, 24, 40, 0.06);
  background: var(--card);
  color: var(--navy);
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  text-align: left;
  opacity: 0;
  animation: aparecer 0.5s ease forwards;
}
@keyframes aparecer {
  to { opacity: 1; }
}
.slot.libre {
  justify-content: space-between;
}
.slot.libre:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.slot.libre:focus-visible {
  outline: 3px solid var(--naranja);
  outline-offset: 2px;
}

/* Hora reservada: foto de Felipe con velo para legibilidad */
.slot.tomado {
  justify-content: flex-end;
  color: var(--blanco);
  cursor: not-allowed;
  border-color: rgba(8, 12, 34, 0.35);
  box-shadow: var(--shadow-sm);
}
.slot-foto {
  position: absolute;
  inset: 0;
  background: url("../assets/brand/reservado.jpg") center 34% / cover no-repeat;
  transition: transform 4s ease;
}
.slot.tomado:hover .slot-foto {
  transform: scale(1.06);
}
/* Línea roja diagonal de "ocupada" */
.slot-linea {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top left,
    transparent calc(50% - 2.5px),
    #e5231f calc(50% - 2.5px),
    #e5231f calc(50% + 2.5px),
    transparent calc(50% + 2.5px)
  );
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.slot-hora {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.slot-estado {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--naranja);
}
.slot.libre:hover .slot-estado {
  color: var(--naranja-osc);
}

/* --- Contador de disponibilidad --- */
.contador {
  text-align: center;
  margin: -6px 0 24px;
  font-size: 0.98rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}
.contador strong {
  font-weight: 800;
  color: var(--blanco);
}

/* --- Avisos --- */
.aviso {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.96rem;
  font-weight: 500;
  background: var(--card);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.aviso.error {
  background: #fff0f0;
  color: #b4272b;
  border: 1px solid rgba(229, 72, 77, 0.4);
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 34, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.modal-card {
  background: var(--card);
  color: var(--navy);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  position: relative;
}
.modal-card.centro {
  text-align: center;
}
.modal-card h2 {
  font-family: var(--font-body);
  font-weight: 800;
  color: var(--navy);
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.08;
}
.modal-hora {
  font-weight: 700;
  color: var(--morado);
  font-size: 1.05rem;
  margin: 0 0 22px;
}
.cerrar {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}
.cerrar:hover {
  color: var(--naranja);
}

/* --- Formularios --- */
form label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 15px;
  font-size: 0.9rem;
}
input,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  background: #f4f6fb;
  border: 1.5px solid #dfe4ee;
  border-radius: 12px;
  color: var(--navy);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #97a1af;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--morado);
  background: var(--blanco);
  box-shadow: 0 0 0 3px rgba(83, 51, 204, 0.14);
}
.btn-primario {
  width: 100%;
  padding: 14px;
  background: var(--naranja);
  color: var(--blanco);
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  margin-top: 6px;
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.32);
}
.btn-primario:hover {
  background: var(--morado);
  box-shadow: 0 10px 24px rgba(83, 51, 204, 0.32);
  transform: translateY(-2px);
}
.btn-primario:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}
.form-error {
  color: #b4272b;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Éxito --- */
.exito-plane {
  width: 92px;
  margin: 0 auto 10px;
  display: block;
  animation: flotar 2.6s ease-in-out infinite;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
.exito-detalle {
  color: var(--text-dim);
  margin: 6px 0 24px;
  font-size: 1.02rem;
}
.exito-detalle strong {
  color: var(--navy);
}

/* --- Pie --- */
.pie {
  text-align: center;
  margin-top: 44px;
}
.pie a {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
}
.pie a:hover {
  color: var(--blanco);
  border-color: var(--blanco);
}

/* --- Gate admin --- */
.gate {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}
.gate .modal-card {
  max-width: 400px;
  position: static;
}
.gate p {
  color: var(--text-dim);
  margin: 0 0 18px;
}

/* --- Panel admin --- */
.panel-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}
.admin-email {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}
.resumen {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.stat {
  flex: 1;
  min-width: 130px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}
.stat .num {
  display: block;
  font-weight: 800;
  font-size: 2.5rem;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 4px;
}
.stat:nth-child(2) .num {
  color: var(--naranja);
}
.stat:nth-child(3) .num {
  color: var(--morado);
}
.tabla-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  color: var(--navy);
}
.tabla th,
.tabla td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid #eaeef4;
}
.tabla th {
  background: var(--navy);
  color: var(--blanco);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tabla tr:last-child td {
  border-bottom: none;
}
.mono {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.chico {
  font-size: 0.84rem;
  color: var(--text-dim);
}
.vacio {
  text-align: center;
  font-size: 1rem;
  color: var(--text-dim);
  padding: 36px 0;
}
.btn-cancelar {
  background: var(--blanco);
  border: 1.5px solid #e5484d;
  color: #b4272b;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
}
.btn-cancelar:hover {
  background: #e5484d;
  color: var(--blanco);
}

/* --- Responsive --- */
@media (max-width: 540px) {
  .grilla {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .topbar .fecha-pill {
    display: none;
  }
  .brand .logo {
    height: 38px;
  }
  .hero {
    padding-top: 38px;
  }
}
