/* ============================================================
   TURNO-STEPPER — Component CSS
   Coherente con ts-crear-view
   ============================================================ */

/* ── WRAPPER ────────────────────────────────────────────── */

.st-wrapper {
    max-width: 1100px;
    margin: 36px auto;
    padding: 0 16px;
}

/* ── PROGRESS BAR ───────────────────────────────────────── */

.st-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.st-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    flex: 1;
    transition: opacity .35s ease, transform .35s ease;
}

.st-step.st-hidden {
    display: none;
}

.st-step.st-fade-out {
    opacity: 0;
    transform: scale(.92);
    pointer-events: none;
}

.st-step.st-fade-in {
    opacity: 0;
    transform: scale(.92);
}

/* Línea conectora */
.st-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--turno-border);
    transition: background .5s ease;
    z-index: 0;
}

.st-step.completed:not(:last-child)::after {
    background: var(--turno-primary);
}

/* Oculta la línea derecha del último paso visible en mobile */
.st-step.st-last-visible:not(:last-child)::after {
    display: none;
}

/* Burbuja */
.st-step-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--turno-border);
    background: var(--turno-white);
    color: var(--turno-text-muted);
    font-size: .85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition:
        border-color .4s ease,
        background .4s ease,
        color .4s ease,
        box-shadow .4s ease,
        transform .3s ease;
}

.st-step.active .st-step-bubble {
    border-color: var(--turno-primary);
    background: linear-gradient(135deg, var(--turno-primary-light) 0%, #c8edf3 100%);
    color: var(--turno-primary-dark);
    box-shadow: 0 0 0 4px rgba(23, 162, 184, .12);
    transform: scale(1.08);
}

.st-step.completed .st-step-bubble {
    border-color: var(--turno-primary-dark);
    background: linear-gradient(135deg, var(--turno-primary) 0%, var(--turno-primary-dark) 100%);
    box-shadow: 0 3px 10px rgba(23, 162, 184, .28);
    color: var(--turno-white);
    transform: scale(1);
}

/* Label */
.st-step-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--turno-text-muted);
    text-align: center;
    white-space: nowrap;
    transition: color .4s ease;
}

.st-step.active .st-step-label,
.st-step.completed .st-step-label {
    color: var(--turno-primary-dark);
}

/* Mobile: solo burbujas */
@media (max-width: 479px) {
    .st-step {
        flex: 0 0 auto;
        width: 120px;
    }

    .st-step-label {
        display: block;
        white-space: normal;
        max-width: 90px;
        font-size: .68rem;
    }
}

/* ── PANEL (card) ───────────────────────────────────────── */

.st-panel {
    background: var(--turno-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--turno-border);
    box-shadow: var(--turno-shadow-card);
    overflow: hidden;
    animation: st-fadein .25s ease;
    transition: opacity .18s ease, transform .18s ease;
}

@keyframes st-fadein {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── PANEL HEADER ───────────────────────────────────────── */

.st-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: linear-gradient(135deg, var(--turno-primary) 0%, var(--turno-primary-dark) 100%);
    color: var(--turno-white);
}

.st-panel-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, .18);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    font-size: 1rem;
}

.st-panel-header-text {
    flex: 1;
    min-width: 0;
}

.st-panel-header-text h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.st-panel-header-text small {
    font-size: .76rem;
    opacity: .82;
    font-weight: 400;
}

/* ── PANEL BODY ─────────────────────────────────────────── */

.st-panel-body {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 24px 24px;
    background: var(--turno-bg);
    min-height: 320px;
}

/* ── CARDS GRID ─────────────────────────────────────────── */

.st-cards-grid {
    display: grid;
    padding-top: 20px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.st-cons-cards-grid {
    display: flex;
    padding-top: 20px;
    gap: 14px;
    justify-content: space-evenly;
}

.st-card {
    border: 1px solid var(--turno-border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    cursor: pointer;
    background: var(--turno-white);
    box-shadow: var(--turno-shadow-sm);
    transition: border-color .2s, box-shadow .2s, transform .18s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-card:hover {
    border-color: var(--turno-primary);
    box-shadow: var(--turno-shadow-focus);
    transform: translateY(-2px);
}

.st-card.selected {
    border-color: var(--turno-primary);
    background: var(--turno-primary-light);
    box-shadow: var(--turno-shadow-focus);
}

.st-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--turno-primary-light);
    color: var(--turno-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.st-card.selected .st-card-icon {
    background: var(--turno-primary);
    color: var(--turno-white);
}

.st-card-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--turno-text);
    line-height: 1.3;
}

.st-card-detail {
    font-size: .78rem;
    color: var(--turno-text-muted);
}

.st-cons-card {
    border: 1px solid var(--turno-border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    cursor: pointer;
    background: var(--turno-white);
    box-shadow: var(--turno-shadow-sm);
    transition: border-color .2s, box-shadow .2s, transform .18s;
    display: flex;
    align-items: center;
    min-width: 350px;
    min-height: 150px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

/* ── Responsive ── */
@media (max-width: 1050px) {
    .st-cons-card {
        min-width: 0px;
        min-height: 0px;
    }
}

.st-cons-card:hover {
    border-color: var(--turno-primary);
    box-shadow: var(--turno-shadow-focus);
    transform: translateY(-2px);
}

.st-cons-card.selected {
    border-color: var(--turno-primary);
    background: var(--turno-primary-light);
    box-shadow: var(--turno-shadow-focus);
}

.st-cons-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--turno-primary-light);
    color: var(--turno-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.st-cons-card.selected .st-cons-card-icon {
    background: var(--turno-primary);
    color: var(--turno-white);
}

.st-cons-card-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--turno-text);
    line-height: 1.3;
}

.st-cons-card-detail {
    font-size: .78rem;
    color: var(--turno-text-muted);
}



/* ── LOADER ─────────────────────────────────────────────── */

.st-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 0;
    color: var(--turno-text-muted);
    font-size: .88rem;
}

.st-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--turno-border);
    border-top-color: var(--turno-primary);
    border-radius: 50%;
    animation: st-spin .7s linear infinite;
}

@keyframes st-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── EMPTY STATE ────────────────────────────────────────── */

.st-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
    color: var(--turno-text-muted);
    font-size: .88rem;
}

.st-empty i {
    font-size: 2rem;
    color: var(--turno-border);
}

/* ── BOTÓN VOLVER ───────────────────────────────────────── */

.st-back-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--turno-white);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    flex-shrink: 0;
}

.st-back-btn:hover {
    border-color: var(--turno-white);
    background: rgba(255, 255, 255, .15);
}

.st-card-badge {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--turno-primary), var(--turno-primary-dark));
    color: var(--turno-white);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-top: 4px;
    white-space: nowrap;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-card-badge i {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* ── Contenedor de filtros ── */
.st-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0px 20px 20px 20px;
    background: var(--turno-bg);
    border-bottom: 1px solid var(--turno-border);
}

.st-cons-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 100%;
    padding: 0px 20px 20px 20px;
    background: var(--turno-bg);
    border-bottom: 1px solid var(--turno-border);
    justify-content: center;
}

/* ── Grupo individual de filtro ── */
.st-filter-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* ── Label — igual que .turno-label ── */
.st-filter-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--turno-primary);
    margin-bottom: 7px;
}

.st-filter-label i {
    font-size: .72rem;
    opacity: .85;
}

.st-cons-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--turno-primary);
    margin-bottom: 7px;
    flex-direction: column;
    align-items: center;
}

/* ── Select wrapper — igual que .turno-select-wrapper ── */
.st-select-wrapper {
    position: relative;
}

.st-select-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: .65rem;
    color: var(--turno-primary);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color .18s;
}

/* ── Select — igual que .turno-select ── */
.st-select {
    display: block;
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: .875rem;
    font-weight: 400;
    color: var(--turno-text);
    background-color: var(--turno-white);
    border: 1px solid #cfe4ec;
    border-radius: var(--radius-md);
    box-shadow: var(--turno-shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    line-height: 1.5;
    cursor: pointer;
}

.st-select:hover {
    border-color: var(--turno-primary);
    background-color: #fafeff;
}

.st-select:focus {
    border-color: var(--turno-primary);
    box-shadow: var(--turno-shadow-focus);
    background-color: var(--turno-white);
}

.st-select option[value=""] {
    color: #a0aec0;
}

/* ── Empty inline (dentro de la grilla, post-filtro) ── */
.st-empty-inline {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
    background: transparent;
    border: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .st-filters {
        flex-direction: column;
        gap: 0;
    }

    .st-filter-group {
        min-width: 100%;
        margin-bottom: 14px;
    }

    .st-filter-group:last-child {
        margin-bottom: 0;
    }
}

/* ── LAYOUT GENERAL ─────────────────────────────────────── */

.st-calendar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* ── WRAPPERS (heredan estilo de .st-panel) ─────────────── */

.st-calendar-wrapper,
.st-hours-wrapper {
    background: var(--turno-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--turno-border);
    box-shadow: var(--turno-shadow-card);
    overflow: hidden;
    animation: st-fadein .25s ease;
}

/* ── HEADERS (heredan estilo de .st-panel-header) ───────── */

.st-calendar-header,
.st-hours-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--turno-primary) 0%, var(--turno-primary-dark) 100%);
    color: var(--turno-white);
    font-weight: 600;
    font-size: .92rem;
}

/* Navegación mes */
.st-calendar-header {
    justify-content: space-between;
}

.st-cal-nav {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--turno-white);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.st-cal-nav:hover {
    border-color: var(--turno-white);
    background: rgba(255, 255, 255, .15);
}

.st-cal-title {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .01em;
}

/* ── TABLA CALENDARIO ───────────────────────────────────── */

.st-calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--turno-bg);
    padding: 0 8px 8px;
}

.st-calendar-table th {
    text-align: center;
    padding: 12px 4px 8px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--turno-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.st-calendar-table td {
    text-align: center;
    padding: 6px 4px;
    font-size: .88rem;
    border-top: 1px solid var(--turno-border);
    color: var(--turno-text);
}

/* ── ESTADOS DE DÍAS ────────────────────────────────────── */

.st-cal-other-month {
    color: var(--turno-border);
}

.st-cal-disabled {
    color: var(--turno-border);
    cursor: default;
}

.st-cal-available {
    color: var(--turno-primary);
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, color .12s;
    border-radius: var(--radius-pill);
}

.st-cal-available:hover {
    background: var(--turno-primary-light);
}

.st-cal-selected {
    background: var(--turno-primary) !important;
    color: var(--turno-white) !important;
    border-radius: var(--radius-pill) !important;
}

/* ── PANEL DE HORAS ─────────────────────────────────────── */

.st-hours-body {
    background: var(--turno-bg);
    padding: 16px;
    min-height: 220px;

    /* Scroll */
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--turno-border) transparent;
}

.st-hours-body::-webkit-scrollbar {
    width: 5px;
}

.st-hours-body::-webkit-scrollbar-track {
    background: transparent;
}

.st-hours-body::-webkit-scrollbar-thumb {
    background: var(--turno-border);
    border-radius: var(--radius-pill);
}

/* Empty / loading — hereda .st-empty */
.st-hours-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 188px;
    /* para que quede centrado dentro del min-height */
    color: var(--turno-text-muted);
    font-size: .88rem;
}

.st-hours-empty i {
    font-size: 2rem;
    color: var(--turno-border);
}

.st-hours-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 188px;
    gap: 8px;
    color: var(--turno-text-muted);
    font-size: .88rem;
}

/* ── GRID DE HORAS ──────────────────────────────────────── */

.st-hours-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.st-hour-btn {
    padding: 9px 6px;
    border: 1px solid var(--turno-border);
    border-radius: var(--radius-md);
    background: var(--turno-white);
    color: var(--turno-primary);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    box-shadow: var(--turno-shadow-sm);
}

.st-hour-btn:hover {
    background: var(--turno-primary-light);
    border-color: var(--turno-primary);
}

.st-hour-btn.selected {
    background: var(--turno-primary);
    border-color: var(--turno-primary);
    color: var(--turno-white);
    box-shadow: var(--turno-shadow-focus);
}

/* ── LAYOUT FINAL ───────────────────────────────────────── */

.st-final-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* ── SUMMARY CARD ───────────────────────────────────────── */

.st-info-wrapper {
    display: grid;
    gap: 20px;
}

.st-summary-card,
.st-form-card {
    background: var(--turno-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--turno-border);
    box-shadow: var(--turno-shadow-card);
    overflow: hidden;
    animation: st-fadein .25s ease;
}

.st-summary-header {
    display: flex;
    align-items: flex-start;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--turno-primary) 0%, var(--turno-primary-dark) 100%);
    color: var(--turno-white);
    font-weight: 600;
    font-size: .88rem;
    flex-direction: column;
}

.st-summary-icontainer {
    display: flex;
    align-items: center;
    gap: 5px;
}

.st-summary-body {
    padding: 16px 18px;
    background: var(--turno-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-summary-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--turno-border);
    font-size: .87rem;
}

.st-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.st-summary-label {
    color: var(--turno-text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}

.st-summary-label i {
    font-size: .8rem;
}

.st-summary-value {
    color: var(--turno-text);
    font-weight: 600;
}

/* ── FORMULARIO ─────────────────────────────────────────── */

.st-form-body {
    padding: 18px;
    background: var(--turno-bg);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.st-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.st-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--turno-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.st-input {
    padding: 9px 12px;
    border: 1px solid var(--turno-border);
    border-radius: var(--radius-md);
    background: var(--turno-white);
    color: var(--turno-text);
    font-size: .88rem;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.st-input:focus {
    border-color: var(--turno-primary);
    box-shadow: var(--turno-shadow-focus);
}

/* Estados de validación */
.st-field-error {
    font-size: .76rem;
    color: #e53e3e;
    display: none;
}

.st-field--error .st-input {
    border-color: #e53e3e;
}

.st-field--error .st-field-error {
    display: block;
}

.st-field--valid .st-input {
    border-color: var(--turno-success);
}

/* Submit */
.st-submit-btn {
    margin-top: 4px;
    padding: 11px;
    background: linear-gradient(135deg, var(--turno-primary) 0%, var(--turno-primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--turno-white);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.st-submit-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.st-submit-btn:visited {
    color: var(--turno-white);
}

.st-submit-btn:not(:disabled):hover {
    opacity: .88;
}

.st-submit-error {
    font-size: .82rem;
    color: #e53e3e;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── SUCCESS ────────────────────────────────────────────── */

.st-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: var(--turno-text);
}

.st-success-icon {
    font-size: 3rem;
    color: var(--turno-success);
}

.st-success h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.st-success p {
    font-size: .88rem;
    color: var(--turno-text-muted);
    margin: 0;
    max-width: 320px;
}

.st-button-div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

a.st-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

a.st-submit-btn:hover {
    color: var(--turno-white);
    text-decoration: none;
}

/* ── RESPONSIVE PASO 3 (< 480px) ───────────────────────── */

@media (max-width: 479px) {

    .st-calendar-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Transición de swap entre calendario y horarios */
    .st-calendar-wrapper,
    .st-hours-wrapper {
        transition: opacity .3s ease, transform .3s ease;
    }

    .st-calendar-wrapper.st-cal-hidden,
    .st-hours-wrapper.st-cal-hidden {
        display: none;
    }

    .st-calendar-wrapper.st-cal-fade-out,
    .st-hours-wrapper.st-cal-fade-out {
        opacity: 0;
        transform: scale(.97);
        pointer-events: none;
    }

    .st-calendar-wrapper.st-cal-fade-in,
    .st-hours-wrapper.st-cal-fade-in {
        opacity: 0;
        transform: scale(.97);
    }

    /* Botón volver al calendario */
    .st-back-to-calendar {
        display: flex;
        align-items: center;
        gap: 8px;
        background: transparent;
        border: none;
        color: var(--turno-white);
        font-size: .82rem;
        font-weight: 600;
        cursor: pointer;
        padding: 0;
        opacity: .85;
        transition: opacity .2s;
    }

    .st-back-to-calendar:hover {
        opacity: 1;
    }

    .st-back-to-calendar i {
        font-size: .78rem;
    }

    /* En desktop el botón no existe, pero por si acaso */
    .st-back-to-calendar {
        display: none;
    }

    @media (max-width: 479px) {
        .st-back-to-calendar {
            display: flex;
        }
    }
}

/* ── RESPONSIVE PASO 4 (< 480px) ───────────────────────── */

@media (max-width: 479px) {

    .st-final-layout {
        grid-template-columns: 1fr;
    }
}