/* Reserva de turnos — hoja de estilos propia, independiente de assets/css/style.css
   del sitio principal (no se carga nunca desde index.php). */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --primary: #455a65;
    --secondary: #4a654f;
    --background: #faf9f7;
    --surface-card: #ffffff;
    --on-surface: #1a1c1b;
    --on-surface-variant: #42474b;
    --outline-variant: #c2c7cb;
    --surface-container-low: #f4f3f1;
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    --shadow-soft: 0 4px 20px rgba(93, 115, 126, 0.08);
    --font-serif: "Source Serif 4", Georgia, serif;
    --font-body: "Hanken Grotesk", -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--on-surface);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--font-serif); color: var(--primary); margin: 0 0 8px; font-weight: 500; }
h1 { font-size: 32px; }
h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
p { margin: 0; }
.text-muted { color: var(--on-surface-variant); }

.turnos-header { padding: 20px; }
.turnos-brand { font-family: var(--font-serif); color: var(--primary); text-decoration: none; font-size: 18px; }

.turnos-main { max-width: 640px; margin: 0 auto; padding: 0 20px 64px; }
.turnos-intro { text-align: center; margin-bottom: 32px; }
.turnos-intro p { margin-top: 8px; }

.modality-toggle { display: flex; gap: 10px; margin-bottom: 24px; }
.modality-option {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    background: var(--surface-container-low);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--on-surface-variant);
    cursor: pointer;
}
.modality-toggle.is-decided { justify-content: center; }
.modality-toggle.is-decided .modality-option { flex: 0 1 auto; min-width: 180px; cursor: default; }
.modality-option.is-modality-hidden { display: none; }
.modality-icon { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.modality-icon svg { width: 100%; height: 100%; }
.modality-option.is-active { border-color: var(--primary); background: var(--surface-card); color: var(--primary); }
.modality-panel.is-hidden { display: none; }
.presencial-alert { display: flex; align-items: center; gap: 10px; }
#goOnlineBtn { display: flex; margin: 16px auto 0; min-width: 180px; width: fit-content; }
.presencial-alert-icon { width: 22px; height: 22px; flex-shrink: 0; }
.presencial-alert-icon svg { width: 100%; height: 100%; }

.turnos-footer { text-align: center; padding: 24px; color: var(--on-surface-variant); font-size: 13px; }

.turnos-panel {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 24px;
    margin-bottom: 20px;
}
.turnos-panel.is-hidden { display: none; }

.step-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* Servicios */
.service-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.service-option {
    text-align: left;
    background: var(--surface-container-low);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-body);
}
.service-option strong { color: var(--primary); font-size: 16px; }
.service-option span { color: var(--on-surface-variant); font-size: 14px; }
.service-option .service-duration { color: var(--secondary); font-weight: 600; }
.service-option:hover { border-color: var(--outline-variant); }
.service-option.is-selected { border-color: var(--primary); background: #fff; }

/* Calendario */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 12px;
    font-weight: 600;
    color: var(--primary);
}
.cal-nav {
    background: var(--surface-container-low);
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 18px;
    cursor: pointer;
    color: var(--primary);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-weekday { text-align: center; font-size: 12px; color: var(--on-surface-variant); font-weight: 600; padding-bottom: 4px; }
.cal-day {
    aspect-ratio: 1;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
}
.cal-day-empty { visibility: hidden; }
.cal-day-disabled { color: var(--outline-variant); cursor: default; }
.cal-day-available { background: var(--surface-container-low); color: var(--on-surface); font-weight: 600; }
.cal-day-available:hover { background: var(--primary); color: #fff; }
.cal-loading { grid-column: 1 / -1; text-align: center; padding: 20px; color: var(--on-surface-variant); }

/* Horarios */
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 420px) {
    .slots-grid { grid-template-columns: repeat(4, 1fr); }
}
.slot-btn {
    padding: 12px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--outline-variant);
    background: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}
.slot-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot-btn-time { display: block; font-size: 15px; }
.slot-btn-ref { display: block; font-size: 10px; font-weight: 500; color: var(--on-surface-variant); margin-top: 2px; }
.slot-btn:hover .slot-btn-ref { color: rgba(255, 255, 255, 0.85); }
.turnos-tz-notice { font-size: 12.5px; margin-top: 2px; margin-bottom: 4px; }

/* Formulario */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--on-surface-variant); margin-bottom: 6px; }
.field-required-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.field input, .field textarea, .field select {
    width: 100%;
    background: var(--surface-container-low);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--on-surface);
    min-height: 48px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* Selector de pais (con bandera en imagen, propio en vez de <select> nativo
   para que la bandera se vea igual en cualquier navegador/sistema operativo). */
.country-select { position: relative; }
.country-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--surface-container-low);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    padding: 12px 14px;
    min-height: 48px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--on-surface);
    cursor: pointer;
    text-align: left;
}
.country-select-trigger:focus { outline: none; border-color: var(--primary); }
.country-select-caret { margin-left: auto; font-size: 10px; opacity: 0.7; flex-shrink: 0; }
.country-flag {
    width: 24px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    display: inline-flex;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.country-flag svg { width: 100%; height: 100%; display: block; }
.country-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-card);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 30;
    padding: 6px;
}
.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 10px;
    background: none;
    border: none;
    border-radius: var(--radius-sm, 6px);
    text-align: left;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--on-surface);
    cursor: pointer;
}
.country-option:hover, .country-option[aria-selected="true"] { background: var(--surface-container-low); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 200ms ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-outline { background: transparent; color: var(--secondary); border-color: var(--secondary); }
.btn-block { width: 100%; margin-top: 4px; }

.form-alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.form-alert.success { background: #c9e7cc; color: #2f4a34; }
.form-alert.error { background: #ffdad6; color: #93000a; }
.form-alert.is-hidden { display: none; }

/* Confirmacion */
.confirm-box { text-align: center; padding: 12px 0; }
.confirm-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.confirm-box h2 { display: block; text-align: center; font-size: 34px; line-height: 1.2; }
.confirm-box p { margin: 12px 0; text-align: center; }
.confirm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
@media (min-width: 480px) {
    .confirm-actions { flex-direction: row; justify-content: center; }
}
