/* =========================================================
   STS Auth Modal — Estilos del modal de registro/login
   ========================================================= */

/* ── Overlay ──────────────────────────────────────────────── */
#sts-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
#sts-auth-modal.sts-modal--open {
    opacity: 1;
    visibility: visible;
}
body.sts-modal-open {
    overflow: hidden;
}

/* ── Caja del modal ───────────────────────────────────────── */
.sts-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 36px;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}
#sts-auth-modal.sts-modal--open .sts-modal-box {
    transform: translateY(0);
}

/* ── Botón cerrar ─────────────────────────────────────────── */
.sts-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.sts-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

/* ── Encabezado ───────────────────────────────────────────── */
.sts-modal-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #011c28;
    text-align: center;
}
.sts-modal-subtitle {
    margin: 0 0 24px;
    font-size: 14px;
    color: #777;
    text-align: center;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.sts-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 24px;
    gap: 0;
}
.sts-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.sts-tab.active {
    color: #011c28;
    border-bottom-color: #011c28;
}
.sts-tab:hover:not(.active) {
    color: #555;
}

/* ── Retroalimentación ────────────────────────────────────── */
.sts-auth-feedback {
    margin-bottom: 16px;
    display: none;
}

/* ── Campos del formulario ────────────────────────────────── */
.sts-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sts-hidden {
    display: none !important;
}

.sts-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sts-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.sts-field label span[aria-hidden] {
    color: #e53935;
}
.sts-field input[type="text"],
.sts-field input[type="email"],
.sts-field input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sts-field input:focus {
    outline: none;
    border-color: #011c28;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(1, 28, 40, 0.08);
}

/* Checkbox */
.sts-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 400;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}
.sts-field--checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #011c28;
}

/* ── Botón de envío ───────────────────────────────────────── */
.sts-btn-submit {
    position: relative;
    width: 100%;
    padding: 13px;
    background: #011c28;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sts-btn-submit:hover:not(:disabled) {
    background: #1a4a5e;
}
.sts-btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}
.sts-btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Spinner */
.sts-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: sts-spin 0.6s linear infinite;
}
@keyframes sts-spin {
    to { transform: rotate(360deg); }
}

/* ── Links de cambio de tab ───────────────────────────────── */
.sts-switch-hint {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin: 12px 0 0;
}
.sts-switch-hint a,
.sts-switch-tab {
    color: #011c28;
    font-weight: 600;
    text-decoration: none;
}
.sts-switch-hint a:hover,
.sts-switch-tab:hover {
    text-decoration: underline;
}

/* ── Continuar como invitado ──────────────────────────────── */
.sts-guest-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: #ccc;
    font-size: 13px;
}
.sts-guest-divider::before,
.sts-guest-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

.sts-btn-guest {
    position: relative;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: #555;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    text-align: center;
}
.sts-btn-guest:hover {
    border-color: #011c28;
    color: #011c28;
    background: #f5f8fa;
}

/* Tooltip */
.sts-guest-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #011c28;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: left;
    pointer-events: none;
    z-index: 10;
}
.sts-guest-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #011c28;
}
.sts-btn-guest:hover .sts-guest-tooltip {
    display: block;
}

/* ── Botones inline dentro del feedback de error ─────────── */
.sts-inline-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 18px;
    border: 2px solid #011c28;
    border-radius: 50px;
    background: #011c28;
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    transition: opacity .15s;
}
.sts-inline-btn:hover { opacity: .8; }
.sts-inline-btn--alt {
    background: transparent;
    color: #011c28;
}
.sts-inline-btn--alt:hover { background: #f0f0f0; opacity: 1; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .sts-modal-box {
        padding: 32px 20px 24px;
        border-radius: 12px;
    }
    .sts-modal-title {
        font-size: 19px;
    }
}
