/* =========================
   CSSMios/Auth.css
   Modales de Registro / Login
   ========================= */

/* ---- Overlay ---- */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;

    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.auth-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Card ---- */
.auth-card {
    width: 100%;
    max-width: 380px;
    background: rgba(22,22,22,.97);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    color: rgba(255,255,255,.92);

    transform: translateY(24px) scale(.96);
    transition: transform .35s cubic-bezier(.22,1,.36,1);
}

.auth-overlay.is-visible .auth-card {
    transform: translateY(0) scale(1);
}

/* ---- Header ---- */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .2s, color .2s, transform .12s, box-shadow .12s;
    -webkit-tap-highlight-color: transparent;
}

.auth-close:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.auth-close:active {
    transform: scale(.9);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.3);
}

/* ---- Campos ---- */
.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.55);
    margin-bottom: 6px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
    box-sizing: border-box;
}

.auth-field input::placeholder {
    color: rgba(255,255,255,.28);
    font-weight: 500;
}

.auth-field input:focus {
    border-color: rgba(56,189,248,.55);
    box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}

/* ---- Checkbox recordar ---- */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: .88rem;
    color: rgba(255,255,255,.65);
    font-weight: 600;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #38bdf8;
    cursor: pointer;
}

/* ---- Botón principal ---- */
.auth-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: .01em;
    transition: transform .12s ease, box-shadow .25s, opacity .2s;
    box-shadow: 0 4px 20px rgba(37,99,235,.35);
    -webkit-tap-highlight-color: transparent;
}

.auth-btn:hover {
    box-shadow: 0 6px 28px rgba(37,99,235,.5);
    transform: translateY(-1px);
}

/* Efecto "se hunde" al pulsar */
.auth-btn:active {
    transform: scale(.95) translateY(2px);
    box-shadow: inset 0 3px 10px rgba(0,0,0,.35), 0 1px 4px rgba(37,99,235,.2);
    transition: transform .06s ease, box-shadow .06s ease;
}

.auth-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Link cambiar modo ---- */
.auth-switch {
    text-align: center;
    margin-top: 18px;
    font-size: .88rem;
    color: rgba(255,255,255,.5);
    font-weight: 600;
}

.auth-switch a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s;
}

.auth-switch a:hover {
    color: #7dd3fc;
}

/* ---- Mensaje error ---- */
.auth-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
    font-size: .85rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: none;
}

.auth-error.is-visible {
    display: block;
    animation: authShake .4s ease;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ---- Campo nombre (solo en registro) ---- */
.auth-field-registro {
    display: none;
}

.auth-overlay[data-mode="registro"] .auth-field-registro {
    display: block;
}

/* ---- Campo correo (solo en registro) ---- */
.auth-field-correo {
    display: none;
}

.auth-overlay[data-mode="registro"] .auth-field-correo {
    display: block;
}

/* ---- Responsivo ---- */
@media (max-width: 420px) {
    .auth-card {
        padding: 24px 20px 22px;
        border-radius: 16px;
    }
}
