
/* ==========================================================================
   1. TOKENS DE DISEÑO (Configuración Global)
   ========================================================================== */
:root {
  --form-control-height: 52px;
  --form-control-compact: 44px;
  --form-radius: 8px;
  --form-gap: 12px;

  --primary-accent: #01070a;
  --border-muted: #ccc;
  --bg-offset: #f8f8f8;
  --modal-overlay: rgba(0, 0, 0, 0.55);

  --transition-fast: 0.2s ease;
  --font-main: inherit;
}

/* ==========================================================================
   2. ESTRUCTURA Y LAYOUT (Grid & Modales)
   ========================================================================== */
.scheduler-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.scheduler-card {
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  padding: 0;
  background: #fff;
  border-radius: 16px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scheduler-header {
  padding: 14px 20px;
  background: linear-gradient(135deg, #e8112d 0%, #c00d25 100%);
  color: white;
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.scheduler-main-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: white;
  text-align: center;
  letter-spacing: 0.3px;
}

.scheduler-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 18px 20px;
}

.scheduler-section {
  padding: 0;
  border-bottom: none;
}

@media screen and (max-width: 768px) {
  .scheduler-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.scheduler-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.scheduler-section-header svg {
  color: #e8112d;
  flex-shrink: 0;
}

.calendar-wrapper {
  background: #fafafa;
  border-radius: 12px;
}

.hour-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hour-option-btn {
  width: 100%;
  max-width: 130px;
  padding: 9px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  background: white;
  color: #333;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all .2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hour-option-btn:focus,
.hour-option-btn:focus-visible {
  outline: none;
}

.hour-option-btn:hover {
  background: #fff5f6;
  border-color: #e8112d;
  color: #e8112d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(232, 17, 45, 0.15);
}

.hour-option-btn.active {
  background: linear-gradient(135deg, #e8112d 0%, #c00d25 100%);
  border-color: #e8112d;
  color: #fff;
  font-weight: 700;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(232, 17, 45, 0.3);
}

.hour-option-btn:disabled,
.hour-option-btn.disabled {
  background: #eef0f3;
  border-color: #d7dbe2;
  color: #9aa3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hour-option-btn:disabled:hover,
.hour-option-btn.disabled:hover {
  background: #eef0f3;
  border-color: #d7dbe2;
  color: #9aa3af;
  transform: none;
  box-shadow: none;
}

.scheduler-open-btn {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 18px;
  border-radius: 40px;
}

.scheduler-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 18px;
  background: #fafafa;
  justify-content: center;
}

.scheduler-actions button {
  flex: 0 0 auto;
  max-width: 140px;
  min-width: 110px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 40px;
  transition: all .2s ease;
  padding: 8px 20px;
}

.scheduler-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.retira-row {
  display: flex;
  gap: 12px;
}

.retira-row .custom-button {
  flex: 1;
  min-width: 0;
}

.custom-form .custom-button.--pill {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 40px;
}

.custom-form .input-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  box-sizing: border-box;
}




/* Limitar ancho del formulario y alinearlo a la izquierda (algo más de la mitad en desktop) */
.form-wrapper,
.custom-form {
  max-width: 960px;
  width: 79%;
  min-width: 560px;
  margin-left: 0;
  margin-right: auto;
}

@media screen and (max-width: 992px) {
  .form-wrapper,
  .custom-form {
    width: 100%;
    min-width: 0;
    max-width: 720px;
  }
}

.form-header-row {
  align-items: center;
}

.form-title {
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 30px;
}

.form-note {
  margin: 0;
  padding: 8px 12px;
  background: #f5f5f5;
  border-left: 4px #e8112d solid;
  color: #333;
  line-height: 1.4;
  font-size: 19px;
}

.richtext-content {
  margin-top: 24px;
}

/* Sistema de Grid Unificado */
.grid-form-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px var(--form-gap);
  margin-bottom: 1.5rem;
  align-items: start;
}

.field-wide { grid-column: span 2; }
.field-full { grid-column: span 4; }

@media screen and (max-width: 768px) {
  .grid-form-row { grid-template-columns: 1fr; }
  .field-wide, .field-full { grid-column: span 1; }
}

.custom-form .small-fields-row .small-field input,
.custom-form .small-fields-row .small-field select {
  width: 100%;
}

.mensaje-temporal {
  width: 100%;
  max-width: 92%;
  padding: 28px;
  border: 2px solid #4a4a4a;
  border-radius: 10px;
  resize: vertical;
}

.form-label-inline {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.select-field {
  width: 100%;
  height: var(--form-control-height);
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--inputBorder, var(--border-muted));
  border-radius: var(--form-radius);
  background: var(--bg-offset);
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  justify-content: center;
}

.form-actions .custom-button {
  max-width: 260px;
  width: 100%;
}

/* Base del formulario (duplicada desde home.css) */
.custom-form .row.small-gaps {
  margin: 0;
  gap: var(--form-gap);
}

.custom-form .row.small-gaps .columns {
  padding-left: 6px;
  padding-right: 6px;
}

/* Botones dentro del formulario */
.custom-form button.custom-button,
.custom-form a.custom-button {
  display: inline-block;
}

.custom-form .custom-button {
  margin: 0;
  border: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 18px;
  text-transform: none;
  background-color: var(--highlight);
  color: var(--onHighlight);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: background-color .3s, color .3s;
  -webkit-appearance: none;
  appearance: none;
}

.custom-form .custom-button.--secondary:not(:disabled) {
  background-color: var(--buttonSecondary);
  color: var(--onButtonSecondary);
}

.custom-form .custom-button.--secondary-option:not(:disabled) {
  background-color: var(--buttonSecondaryOption);
  color: var(--onButtonSecondaryOption);
}

.custom-form .custom-button:disabled {
  background-color: #888;
  color: #c8c8c8;
  cursor: default;
}

@media screen and (min-width: 1024px) {
  .custom-form .custom-button:not(:disabled):hover {
    background-color: var(--buttonPrimaryHover);
  }

  .custom-form .custom-button.--secondary:not(:disabled):hover {
    background-color: var(--buttonSecondaryHover);
  }

  .custom-form .custom-button.--secondary-option:not(:disabled):hover {
    background-color: var(--buttonSecondaryOptionHover);
  }
}

/* ========================================================================
   3. COMPONENTES DE FORMULARIO (Inputs Unificados)
   ======================================================================== */
.custom-input-group {
  position: relative;
  width: 100%;
}

.custom-input-group input,
.custom-input-group textarea {
  width: 100%;
  height: var(--form-control-height);
  padding: 18px 10px 4px;
  font-size: 18px;
  font-weight: 700;
  background-color: var(--input, #fff);
  border: 2px solid var(--inputBorder, var(--border-muted));
  border-radius: var(--form-radius);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
  appearance: none;
}

.custom-input-group.--compact input {
  height: var(--form-control-compact);
  font-size: 16px;
  padding: 12px 10px 2px;
}

/* Lógica de Floating Label */
.custom-input-group .float-label {
  position: absolute;
  top: 0;
  left: 10px;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-size: 18px;
  color: #666;
  transition: all var(--transition-fast);
}

.custom-input-group input:focus + .float-label,
.custom-input-group input:not(:placeholder-shown) + .float-label,
.custom-input-group input.--ready + .float-label,
.custom-input-group textarea:focus + .float-label,
.custom-input-group textarea:not(:placeholder-shown) + .float-label {
  height: 14px;
  font-size: 12px;
  transform: translateY(6px);
  color: var(--primary-accent);
}

/* 5. BOTONES (abstracción de estilos) */
.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--form-control-height);
  padding: 0 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: .3s;
  text-align: center;
  font-family: var(--font-main);
}

.btn-pill {
  border-radius: 40px;
  width: 100%;
}

.btn-primary {
  background-color: var(--highlight);
  color: var(--onHighlight);
}

.btn-hour {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  background: var(--bg-offset);
}

.btn-hour.active {
  background: var(--primary-accent);
  color: #fff;
  border-color: var(--primary-accent);
}


/* Fix: asegurar que el documento permita scroll vertical si estaba deshabilitado */
html, body {
  overflow-y: auto;
  overscroll-behavior: auto;
}

