/* ============================================================
   Turnero web publico - Sanatorio Central Banda
   Estilos basados en el diseno Figma "Turnos SCB".
   ============================================================ */

:root {
    --st-bg: #f7f8f9;
    --st-card: #ffffff;
    --st-navy: #0e5d72;
    --st-blue: #3ba2c4;
    --st-blue-soft: #e8f4f9;
    --st-teal: #13b3a6;
    --st-teal-dark: #0fa093;
    --st-text: #1f2937;
    --st-muted: #6b7280;
    --st-border: #e5e7eb;
    --st-border-sel: #7cc6dd;
    --st-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --st-radius: 12px;
}

html { font-size: 14px; }

body.st-body {
    background: var(--st-bg);
    color: var(--st-text);
    font-family: 'Source Sans Pro', 'Open Sans', system-ui, -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}
.st-page, .st-page *, .st-page *::before, .st-page *::after { box-sizing: border-box; }

.st-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.st-container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1 0 auto;
}

/* Header / logo */
.st-header {
    text-align: center;
    padding: 36px 20px 8px;
}
.st-header img {
    max-height: 96px;
    width: auto;
}

/* Titulos */
.st-title {
    color: var(--st-navy);
    font-size: 30px;
    font-weight: 700;
    margin: 28px 0 6px;
}
.st-subtitle {
    color: var(--st-muted);
    font-size: 15px;
    margin: 0 0 24px;
}
.st-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--st-text);
    margin: 28px 0 14px;
}

/* Buscador */
.st-search {
    position: relative;
    margin-bottom: 22px;
}
.st-search input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 0 16px 0 46px;
    font-size: 15px;
    background: var(--st-card);
    box-shadow: var(--st-shadow);
    outline: none;
}
.st-search input:focus { border-color: var(--st-border-sel); }
.st-search .st-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-muted);
}

/* Grid de tarjetas */
.st-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.st-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Tarjeta seleccionable (especialidad, estudio, profesional) */
.st-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--st-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 18px 18px;
    box-shadow: var(--st-shadow);
    text-decoration: none;
    color: var(--st-text);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.st-card:hover {
    border-color: var(--st-border-sel);
    color: var(--st-text);
}
.st-card.is-selected {
    border-color: var(--st-blue);
    box-shadow: 0 0 0 2px rgba(59, 162, 196, .25);
}
.st-card-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--st-blue-soft);
    color: var(--st-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.st-card-body { flex: 1 1 auto; min-width: 0; }
.st-card-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.st-card-sub {
    color: var(--st-muted);
    font-size: 13px;
}
.st-card-chevron { color: var(--st-blue); flex: 0 0 auto; }

.st-empty {
    color: var(--st-muted);
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

/* Footer */
.st-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 22px 20px 28px;
    border-top: 1px solid var(--st-border);
    margin-top: 36px;
    color: var(--st-muted);
    font-size: 13px;
}
.st-footer a {
    color: var(--st-muted);
    text-decoration: underline;
    margin: 0 8px;
}

/* ---- Pantalla informativa (Laboratorio / Imagenes) ---- */
.st-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
}
.st-info-card {
    background: var(--st-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 20px;
    box-shadow: var(--st-shadow);
}
.st-info-card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
}
.st-info-card .st-info-sub {
    color: var(--st-muted);
    font-size: 13px;
    margin-bottom: 14px;
}
.st-info-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed var(--st-border);
    font-size: 14px;
}
.st-info-row:last-child { border-bottom: 0; }
.st-info-row .st-hrs { font-weight: 700; color: var(--st-navy); }

.st-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    margin-top: 14px;
}

.st-contact {
    background: var(--st-teal);
    color: #fff;
    border-radius: var(--st-radius);
    padding: 22px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.st-contact h4 { margin: 0 0 4px; font-size: 17px; }
.st-contact p { margin: 0; opacity: .92; font-size: 14px; }

/* Botones */
.st-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.st-btn-primary { background: var(--st-teal); color: #fff; }
.st-btn-primary:hover { background: var(--st-teal-dark); color: #fff; }
.st-btn-light { background: #fff; color: var(--st-teal-dark); }
.st-btn-secondary { background: #eef0f2; color: var(--st-text); }
.st-btn-block { width: 100%; justify-content: center; }

.st-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--st-muted);
    text-decoration: none;
    font-size: 14px;
    margin: 18px 0;
}
.st-back-link:hover { color: var(--st-navy); }

/* ---- Progress stepper (Pasos 2-4) ---- */
.st-stepper { margin: 22px 0 26px; }
.st-stepper-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.st-stepper-step { color: var(--st-blue); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.st-stepper-pct { color: var(--st-muted); font-size: 13px; }
.st-stepper-bar { height: 8px; background: #e6e9ec; border-radius: 6px; overflow: hidden; }
.st-stepper-fill { height: 100%; background: var(--st-teal); border-radius: 6px; transition: width .3s; }
.st-stepper-next { color: var(--st-muted); font-size: 14px; margin-top: 8px; }

/* ---- Filtros (Paso 2) ---- */
.st-filters { display: flex; gap: 10px; align-items: center; margin: 16px 0 18px; flex-wrap: wrap; }
.st-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--st-border); background: #fff; color: var(--st-text);
    border-radius: 8px; padding: 9px 14px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.st-filter-btn.is-on { background: var(--st-blue); border-color: var(--st-blue); color: #fff; }
.st-select {
    border: 1px solid var(--st-border); background: #fff; color: var(--st-text);
    border-radius: 8px; padding: 9px 12px; font-size: 14px; min-width: 180px;
}
.st-check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--st-text); cursor: pointer; user-select: none; }
.st-check input { width: 17px; height: 17px; accent-color: var(--st-teal); cursor: pointer; margin: 0; }

/* ---- Tarjeta de profesional ---- */
.st-avatar {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
    background: var(--st-blue-soft); color: var(--st-navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
}
.st-prof-meta { display: flex; align-items: center; gap: 6px; color: var(--st-muted); font-size: 13px; margin-top: 4px; }
.st-prof-meta b { color: var(--st-text); }

/* ---- Navegacion inferior ---- */
.st-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--st-border); margin-top: 28px; padding-top: 18px; }
.st-nav .st-btn-primary[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Paso 3: dos columnas ---- */
.st-cols { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }

/* Calendario */
.st-cal { background: var(--st-card); border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 16px; box-shadow: var(--st-shadow); }
.st-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.st-cal-title { font-weight: 700; color: var(--st-navy); text-transform: capitalize; }
.st-cal-nav { border: 0; background: transparent; color: var(--st-navy); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.st-cal-nav:hover { background: var(--st-blue-soft); }
.st-cal-nav[disabled] { opacity: .3; cursor: not-allowed; }
.st-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.st-cal-dow { text-align: center; font-size: 11px; color: var(--st-muted); padding: 4px 0; font-weight: 700; }
.st-cal-day {
    aspect-ratio: 1 / 1; border: 0; background: transparent; border-radius: 50%;
    font-size: 13px; color: var(--st-text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.st-cal-day.is-empty { visibility: hidden; }
.st-cal-day.is-disabled { color: #cbd1d8; cursor: not-allowed; }
.st-cal-day.is-available:hover { background: var(--st-blue-soft); }
.st-cal-day.is-selected { background: var(--st-blue); color: #fff; }
.st-cal-prof { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--st-border); margin-top: 14px; padding-top: 12px; }
.st-cal-prof .st-avatar { width: 40px; height: 40px; font-size: 14px; }

/* Ofertas (slots / orden de llegada) */
.st-ofertas-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
/* Horas grandes y legibles (pensado para adultos mayores). */
.st-slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.st-slot {
    border: 1px solid var(--st-border); background: #fff; border-radius: 10px;
    padding: 18px 8px; font-size: 21px; font-weight: 600; cursor: pointer; text-align: center; color: var(--st-text);
}
.st-slot:hover { border-color: var(--st-border-sel); }
.st-slot.is-selected { border-color: var(--st-blue); color: var(--st-blue); box-shadow: 0 0 0 2px rgba(59,162,196,.25); font-weight: 700; }
.st-orden {
    border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 20px; background: #fff;
    cursor: pointer; margin-bottom: 12px;
}
.st-orden.is-selected { border-color: var(--st-blue); box-shadow: 0 0 0 2px rgba(59,162,196,.2); }
.st-orden h4 { margin: 0 0 6px; font-size: 17px; }
.st-orden .st-orden-rango { color: var(--st-text); font-size: 22px; font-weight: 700; }
.st-orden .st-badge { display: inline-block; background: var(--st-blue-soft); color: var(--st-navy); border-radius: 20px; padding: 5px 14px; font-size: 15px; font-weight: 700; margin-top: 10px; }
.st-sel-info {
    display: flex; gap: 10px; align-items: flex-start; background: var(--st-blue-soft);
    border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--st-navy); margin-top: 16px;
}
.st-loading { color: var(--st-muted); padding: 20px; text-align: center; }

/* ---- Paso 4: resumen + formulario ---- */
.st-resumen { background: var(--st-card); border: 1px solid var(--st-border); border-radius: var(--st-radius); padding: 18px 20px; box-shadow: var(--st-shadow); margin-bottom: 8px; }
.st-resumen-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--st-navy); margin-bottom: 14px; }
.st-resumen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.st-resumen-label { color: var(--st-muted); font-size: 11px; letter-spacing: .05em; font-weight: 700; }
.st-resumen-value { font-weight: 700; font-size: 14px; margin-top: 2px; }
.st-resumen-sub { color: var(--st-blue); font-size: 13px; }

.st-fieldset { margin-top: 22px; }
.st-fieldset-title { border-left: 3px solid var(--st-teal); padding-left: 10px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.st-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.st-field { display: flex; flex-direction: column; }
.st-field label { font-size: 13px; color: var(--st-text); margin-bottom: 6px; }
.st-field input, .st-field textarea {
    border: 1px solid var(--st-border); border-radius: 10px; padding: 11px 14px; font-size: 14px;
    background: #fff; outline: none; font-family: inherit; resize: vertical;
}
.st-field input:focus, .st-field textarea:focus { border-color: var(--st-border-sel); }
.st-readonly {
    border: 1px solid var(--st-border); background: #f1f4f6; border-radius: 10px;
    padding: 11px 14px; font-size: 15px; font-weight: 700; color: var(--st-navy);
}
.st-field-hint { color: var(--st-muted); font-size: 12px; margin-top: 5px; }
.st-saludo {
    display: flex; align-items: center; gap: 10px;
    background: #e7f8f3; border: 1px solid #b6e8da; color: #0f766e;
    border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 14px;
}

.st-exito-check {
    width: 72px; height: 72px; border-radius: 50%; background: #e7f8f3; color: var(--st-teal);
    display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Totem publico ---- */
.st-totem {
    max-width: 880px;
    margin: 0 auto;
    padding: 18px 0 24px;
}
.st-totem-head {
    text-align: center;
    margin-bottom: 28px;
}
.st-totem-head .st-title {
    font-size: 42px;
    margin-top: 12px;
}
.st-totem-head .st-subtitle {
    font-size: 20px;
}
.st-totem-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
.st-totem-action {
    min-height: 150px;
    padding: 28px 30px;
    border-radius: var(--st-radius);
}
.st-totem-action .st-card-title {
    display: block;
    font-size: 32px;
    line-height: 1.15;
}
.st-totem-action .st-card-sub {
    display: block;
    font-size: 18px;
    margin-top: 8px;
}
.st-totem-icon {
    width: 76px;
    height: 76px;
    border-radius: 14px;
}
.st-totem-list {
    max-width: 980px;
}
.st-totem-form {
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 16px;
    align-items: end;
}
.st-totem-form .st-field label {
    font-size: 18px;
    font-weight: 700;
}
.st-totem-form .st-field input {
    height: 66px;
    font-size: 28px;
    font-weight: 700;
}
.st-totem-submit {
    min-height: 66px;
    justify-content: center;
    font-size: 22px;
}
.st-totem-all-submit {
    grid-column: 1 / -1;
}
.st-totem-empty {
    background: var(--st-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    font-size: 20px;
    margin-top: 18px;
}
.st-turnos-dia {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}
.st-turno-card {
    display: grid;
    grid-template-columns: 135px 1fr;
    gap: 22px;
    align-items: center;
    margin-bottom: 0;
}
.st-turno-time {
    color: var(--st-navy);
    font-size: 38px;
    font-weight: 700;
    text-align: center;
    line-height: 1;
}
.st-turno-time-full {
    display: grid;
    gap: 6px;
}
.st-turno-date {
    color: var(--st-blue);
    font-size: 18px;
    line-height: 1.15;
}
.st-turno-content h2 {
    color: var(--st-text);
    font-size: 25px;
    font-weight: 700;
    margin: 0 0 8px;
}
.st-turno-line {
    color: var(--st-muted);
    font-size: 18px;
    margin-top: 4px;
}
.st-turno-state-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.st-turno-state {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 20px;
    background: var(--st-blue-soft);
    color: var(--st-navy);
    font-size: 15px;
    font-weight: 700;
}
.st-turno-admin-note {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

/* QR de confirmacion en la pantalla de exito */
.st-qr {
    display: flex; align-items: center; gap: 18px;
    background: var(--st-card); border: 1px solid var(--st-border); border-radius: var(--st-radius);
    padding: 18px 20px; box-shadow: var(--st-shadow);
}
.st-qr-code { flex: 0 0 auto; width: 130px; height: 130px; }
.st-qr-code svg { width: 130px; height: 130px; display: block; }
.st-qr-text h4 { margin: 0 0 4px; font-size: 16px; color: var(--st-navy); }
.st-qr-text p { margin: 0; color: var(--st-muted); font-size: 13px; }

/* Impresion: solo el comprobante, sin botones ni footer */
@media print {
    body.st-body { background: #fff; }
    .st-no-print, .st-footer, .st-back-link { display: none !important; }
    .st-resumen, .st-qr, .st-note { box-shadow: none; }
}

/* ---- Select2 (buscador de obra social) ajustado al diseno ----
   Base = Paso 4 (junto a los inputs del formulario, alto 44 / radio 10). */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid var(--st-border);
    border-radius: 10px;
    background: #fff;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 14px;
    padding-right: 28px;
    color: var(--st-text);
    font-size: 14px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--st-muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: 6px; }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--st-muted); margin-right: 4px; font-weight: 400; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--st-border-sel); }
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--st-border-sel); }
.select2-dropdown { border-color: var(--st-border); border-radius: 10px; overflow: hidden; }
.select2-container--default .select2-results__option { font-size: 14px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--st-blue); }
.select2-search--dropdown .select2-search__field { border-color: var(--st-border); border-radius: 8px; padding: 6px 10px; outline: none; }

/* Paso 2 = filtro, compacto y alineado con el boton "Disponible hoy" (alto 38 / radio 8). */
.st-filters .select2-container { flex: 0 0 auto; }
.st-filters .select2-container--default .select2-selection--single { height: 38px; border-radius: 8px; }
.st-filters .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; }
.st-filters .select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }

/* Responsive */
@media (max-width: 880px) {
    .st-grid { grid-template-columns: repeat(2, 1fr); }
    .st-cols { grid-template-columns: 1fr; }
    .st-resumen-grid { grid-template-columns: 1fr; }
    .st-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .st-grid, .st-grid-2, .st-info-grid { grid-template-columns: 1fr; }
    .st-title { font-size: 25px; }
    .st-slots-grid { grid-template-columns: repeat(2, 1fr); }
    .st-totem-head .st-title { font-size: 34px; }
    .st-totem-head .st-subtitle { font-size: 17px; }
    .st-totem-action { min-height: 126px; padding: 22px 20px; }
    .st-totem-action .st-card-title { font-size: 25px; }
    .st-totem-action .st-card-sub { font-size: 16px; }
    .st-totem-icon { width: 58px; height: 58px; }
    .st-totem-form { grid-template-columns: 1fr; }
    .st-turno-card { grid-template-columns: 1fr; gap: 10px; }
    .st-turno-time { text-align: left; font-size: 34px; }
    .st-turno-content h2 { font-size: 22px; }
    .st-turno-line { font-size: 16px; }
}
