/* ── VARIABLES CORPORATIVAS VERVIA ──────────────────────────────────────────── */
:root {
  /* Paleta principal */
  --vervia-gold:        #C9A96E;
  --vervia-gold-dark:   #A8883F;
  --vervia-gold-light:  #E8D5A3;
  --vervia-navy:        #1C2B4A;
  --vervia-navy-mid:    #243356;
  --vervia-navy-light:  #2D3F6B;
  --vervia-pearl:       #F5F2EC;
  --vervia-gray:        #8892A4;
  --vervia-gray-light:  #B0B8C6;
  --vervia-white:       #FFFFFF;

  /* Semáforo de estados — NO MODIFICAR */
  --status-pending:     #F59E0B;
  --status-ok:          #10B981;
  --status-error:       #EF4444;
  --status-cancelled:   #6B7280;
  --status-info:        #3B82F6;

  /* Tipografía */
  --font-primary:  'Inter', system-ui, sans-serif;
  --font-display:  'Playfair Display', Georgia, serif;

  /* Espaciado y radios */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.4);

  /* Transiciones */
  --transition: 0.18s ease;

  /* Aliases semánticos para las plantillas */
  --bg:         var(--vervia-navy);
  --surface:    var(--vervia-navy-mid);
  --surface-2:  var(--vervia-navy-light);
  --accent:     var(--vervia-gold);
  --accent-dark: var(--vervia-gold-dark);
  --text:       var(--vervia-white);
  --text-muted: var(--vervia-gray);
  --border:     rgba(201, 169, 110, 0.15);
}

/* ── RESET Y BASE ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  background-color: var(--vervia-navy);
  color: var(--vervia-white);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--vervia-gold); text-decoration: none; }
a:hover { color: var(--vervia-gold-light); }

/* ── LOGO Y MARCA ────────────────────────────────────────────────────────────── */
.app-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--vervia-gold);
  letter-spacing: 0.02em;
}
.app-logo span {
  color: var(--vervia-white);
  font-weight: 300;
}
.app-logo-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
  gap: 0.18rem;
}
.app-logo-tagline {
  font-size: 0.65rem;
  color: #8892A4;
  letter-spacing: 0.1em;
  font-family: var(--font-body);
  font-weight: 400;
}

/* ── CABECERA PRINCIPAL ──────────────────────────────────────────────────────── */
.app-header {
  height: 56px;
  background: rgba(28, 43, 74, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--vervia-gray);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.header-nav a {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--vervia-gray-light);
  transition: background var(--transition), color var(--transition);
}
.header-nav a:hover,
.header-nav a.active {
  background: var(--vervia-navy-light);
  color: var(--vervia-white);
}
.header-nav a.active {
  color: var(--vervia-gold);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vervia-navy-light);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vervia-gold);
}

/* ── LAYOUT PRINCIPAL ────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: calc(100vh - 56px);
}

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--vervia-navy-mid);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-section {
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--vervia-gray);
  padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--vervia-gray-light);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.sidebar-link:hover {
  background: var(--vervia-navy-light);
  color: var(--vervia-white);
}
.sidebar-link.active {
  background: rgba(201, 169, 110, 0.12);
  color: var(--vervia-gold);
}
.sidebar-link .icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── BOTONES ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--vervia-gold);
  color: var(--vervia-navy);
  font-weight: 600;
  border-color: var(--vervia-gold);
}
.btn-primary:hover:not(:disabled) {
  background: var(--vervia-gold-dark);
  border-color: var(--vervia-gold-dark);
  color: var(--vervia-navy);
}

.btn-secondary {
  background: transparent;
  color: var(--vervia-gold);
  border-color: var(--vervia-gold);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(201, 169, 110, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--vervia-gray-light);
  border-color: rgba(136, 146, 164, 0.3);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--vervia-navy-light);
  color: var(--vervia-white);
}

.btn-danger {
  background: transparent;
  color: var(--status-error);
  border-color: var(--status-error);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.65rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Botones de navegación del flujo público ───────────────────────────────── */
.btn-nav {
  background: transparent;
  color: var(--vervia-gold);
  border-color: transparent;
  padding: 2px 0;
  font-size: 0.8rem;
  font-weight: 400;
}
.btn-nav:hover:not(:disabled) {
  background: transparent;
  color: var(--vervia-gold);
  text-decoration: underline;
}
.btn-cancel-flow {
  background: transparent;
  color: #8892A4;
  border-color: transparent;
  padding: 2px 0;
  font-size: 0.8rem;
  font-weight: 400;
}
.btn-cancel-flow:hover {
  background: transparent;
  color: #EF4444;
  text-decoration: none;
}

/* ── INPUTS ──────────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--vervia-gray-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  background: var(--vervia-navy);
  border: 1px solid rgba(136, 146, 164, 0.3);
  border-radius: var(--radius-sm);
  color: var(--vervia-white);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control::placeholder { color: var(--vervia-gray); }
.form-control:focus {
  outline: none;
  border-color: var(--vervia-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}

select.form-control {
  background-color: var(--vervia-navy) !important;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--vervia-gray);
}

/* ── CARDS ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--vervia-navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--vervia-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── BADGES DE ESTADO ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-bloqueada    { background: rgba(245,158,11,0.15);  color: var(--status-pending);   }
.badge-confirmada   { background: rgba(16,185,129,0.15);  color: var(--status-ok);        }
.badge-completada   { background: rgba(59,130,246,0.15);  color: var(--status-info);      }
.badge-cancelada    { background: rgba(107,114,128,0.15); color: var(--status-cancelled); }
.badge-error        { background: rgba(239,68,68,0.15);   color: var(--status-error);     }

/* ── MODALES ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--vervia-navy-mid);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateY(-12px);
  transition: transform 0.2s ease;
}
.modal-backdrop.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--vervia-gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--vervia-gray);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--vervia-white); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── TOASTS ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--vervia-navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.2s ease forwards;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  max-width: 380px;
}
.toast.ok      { border-left: 3px solid var(--status-ok);        }
.toast.error   { border-left: 3px solid var(--status-error);     }
.toast.warning { border-left: 3px solid var(--status-pending);   }
.toast.info    { border-left: 3px solid var(--status-info);      }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── TABLAS ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vervia-gray);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(136, 146, 164, 0.08);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(45, 63, 107, 0.4); }
tbody tr:last-child td { border-bottom: none; }

/* ── PAGINACIÓN ──────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.page-btn {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid rgba(136, 146, 164, 0.25);
  background: transparent;
  color: var(--vervia-gray-light);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.page-btn:hover { background: var(--vervia-navy-light); color: var(--vervia-white); }
.page-btn.active {
  background: var(--vervia-gold);
  color: var(--vervia-navy);
  border-color: var(--vervia-gold);
  font-weight: 600;
}

/* ── ESTADÍSTICAS / MÉTRICAS ─────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--vervia-navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vervia-gray);
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--vervia-white);
  line-height: 1;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--vervia-gray);
  margin-top: 0.2rem;
}

.metric-accent  { border-top: 2px solid var(--vervia-gold); }
.metric-ok      { border-top: 2px solid var(--status-ok); }
.metric-pending { border-top: 2px solid var(--status-pending); }
.metric-error   { border-top: 2px solid var(--status-error); }
.metric-error .metric-value { color: var(--status-error); }

/* ── SELECTOR DE HORA (FLUJO PÚBLICO) ────────────────────────────────────────── */
.franjas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}

.franja-btn {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(136, 146, 164, 0.25);
  background: var(--vervia-navy-mid);
  color: var(--vervia-white);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.franja-btn:hover:not(.ocupada) {
  border-color: var(--vervia-gold);
  color: var(--vervia-gold);
}
.franja-btn.selected {
  background: var(--vervia-gold);
  border-color: var(--vervia-gold);
  color: var(--vervia-navy);
  font-weight: 700;
}
.franja-btn.ocupada {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── STEPPER (FLUJO PÚBLICO) ─────────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(136, 146, 164, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vervia-gray);
  background: var(--vervia-navy-mid);
  transition: all var(--transition);
}
.step.active .step-circle {
  border-color: var(--vervia-gold);
  color: var(--vervia-gold);
  background: rgba(201, 169, 110, 0.1);
}
.step.done .step-circle {
  border-color: var(--status-ok);
  background: var(--status-ok);
  color: var(--vervia-white);
}

.step-label {
  font-size: 0.7rem;
  color: var(--vervia-gray);
  text-align: center;
}
.step.active .step-label { color: var(--vervia-gold); }

.step-line {
  height: 2px;
  width: 60px;
  background: rgba(136, 146, 164, 0.2);
  margin-bottom: 1.1rem;
}
.step-line.done { background: var(--status-ok); }

/* ── PÁGINA PÚBLICA — LAYOUT ─────────────────────────────────────────────────── */
.public-page {
  min-height: 100vh;
  background: var(--vervia-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.public-header {
  text-align: center;
  margin-bottom: 0.25rem;
}


.public-card {
  background: var(--vervia-navy-mid);
  border: 1px solid rgba(201,169,110,0.22);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.25);
}

/* Icono de paso centrado en el card */
.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.28);
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  color: var(--vervia-gold);
}
.step-icon svg {
  width: 28px;
  height: 28px;
}

/* Texto de confianza al pie del card */
.trust-text {
  text-align: center;
  font-size: 0.71rem;
  color: var(--vervia-gray);
  margin-top: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  letter-spacing: 0.01em;
}

.public-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--vervia-gold);
  margin-bottom: 0.5rem;
}

.public-card-subtitle {
  font-size: 0.875rem;
  color: var(--vervia-gray);
  margin-bottom: 1.5rem;
}

/* ── LOGIN ───────────────────────────────────────────────────────────────────── */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-left { display: none; }
}

.login-left {
  background: var(--vervia-navy-mid);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.login-logo-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--vervia-gold);
  box-shadow: 0 0 30px rgba(201, 169, 110, 0.2);
}

.login-tagline {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--vervia-gold);
  text-align: center;
  line-height: 1.3;
}

.login-tagline-sub {
  font-size: 0.875rem;
  color: var(--vervia-gray);
  text-align: center;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.login-form-wrap {
  width: 100%;
  max-width: 360px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--vervia-gray);
  margin-bottom: 2rem;
}

/* ── ALERTAS ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}
.alert-ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FCD34D;
}

/* ── UTILIDADES ──────────────────────────────────────────────────────────────── */
.text-gold    { color: var(--vervia-gold); }
.text-muted   { color: var(--vervia-gray); }
.text-ok      { color: var(--status-ok); }
.text-error   { color: var(--status-error); }
.text-pending { color: var(--status-pending); }

.d-flex   { display: flex; }
.d-none   { display: none; }
.gap-1    { gap: 0.25rem; }
.gap-2    { gap: 0.5rem; }
.gap-3    { gap: 0.75rem; }
.gap-4    { gap: 1rem; }
.mt-1     { margin-top: 0.25rem; }
.mt-2     { margin-top: 0.5rem; }
.mt-3     { margin-top: 0.75rem; }
.mt-4     { margin-top: 1rem; }
.mb-1     { margin-bottom: 0.25rem; }
.mb-2     { margin-bottom: 0.5rem; }
.mb-3     { margin-bottom: 0.75rem; }
.mb-4     { margin-bottom: 1rem; }
.ml-auto  { margin-left: auto; }
.w-100    { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.separator {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(201,169,110,0.3);
  border-top-color: var(--vervia-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOGO DEL DESPACHO — FLUJO PÚBLICO ──────────────────────────────────────── */
.public-logo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--vervia-gold);
  box-shadow: 0 0 36px rgba(201,169,110,0.28), 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 1.1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ── SUBTÍTULO "RESERVA DE CITA ONLINE" ─────────────────────────────────────── */
.public-subtitle-bar {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  margin: 6px 0 0;
  overflow: hidden;
}
.public-subtitle-text {
  white-space: nowrap;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
  color: #8892A4;
  font-family: Inter, sans-serif;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet / phablet */
@media (max-width: 560px) {
  .public-page { overflow-x: hidden; }
  .public-card { padding: 1.25rem; border-radius: var(--radius-lg); }
  .metrics-grid { grid-template-columns: 1fr; }

  /* Logo */
  .public-logo { width: 88px; height: 88px; margin-bottom: 0.85rem; }

  /* Stepper — ocultar labels de pasos no activos */
  .stepper { margin-bottom: 1.25rem; }
  .step:not(.active) .step-label { display: none; }
  .step-line { width: 32px; }

  /* Franjas horarias — 3 columnas */
  .franjas-grid { grid-template-columns: repeat(3, 1fr); }

  /* Celdas de calendario — mínimo touch target */
  .cal-day { min-height: 36px; }

  /* Botones primarios grandes — ancho total */
  .btn-lg {
    padding: 0.875rem 1rem;
    width: 100%;
    justify-content: center;
    display: flex;
  }

  /* Botones de navegación — área táctil mínima 44px */
  .btn-nav, .btn-cancel-flow {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Móvil pequeño (≤ 480px) */
@media (max-width: 480px) {
  .public-page { padding: 1.25rem 0.75rem; }
  .public-logo { width: 80px; height: 80px; }

  /* Subtítulo: eliminar el truco vw, reducir letter-spacing */
  .public-subtitle-bar { width: 100%; left: 0; transform: none; }
  .public-subtitle-text { letter-spacing: 0.1em; font-size: 0.65rem; }

  /* Card padding mínimo */
  .public-card { padding: 1rem; }

  /* Stepper: reducir líneas aún más */
  .step-line { width: 20px; }
  .step-circle { width: 28px; height: 28px; font-size: 0.75rem; }

  /* Calendario encabezados */
  .cal-header { font-size: 0.65rem; letter-spacing: 0; }

  /* Antes/después en modificar_resumen — apilar en muy pequeño */
  .mod-compare-grid { grid-template-columns: 1fr !important; }
}

/* iPhone SE y similares (≤ 360px) */
@media (max-width: 360px) {
  .public-page { padding: 1rem 0.5rem; }
  .public-card { padding: 0.875rem; }
  .stepper { gap: 0; }
  .step-line { width: 14px; }
}

/* ── Modales de confirmación/alerta personalizados ───────────────────────── */
.vv-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.65);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.vv-modal-overlay.open { display: flex; }
.vv-modal-dialog {
  background: #1C2B4A;
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: var(--radius-md);
  width: 100%; max-width: 420px;
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  animation: vvDialogIn 0.18s ease;
}
@keyframes vvDialogIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.vv-modal-title {
  font-family: 'Playfair Display', serif;
  color: var(--vervia-gold);
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
}
.vv-modal-msg {
  color: #b0bad0;
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 0 0 1.5rem;
  white-space: pre-wrap;
}
.vv-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
