/* ==========================================================
   PROJECT RED — Estilos de autenticación (login/register)
========================================================== */

.auth-wrap {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    padding: 24px 20px;
    place-items: center;
    position: relative;
}

@media (min-width: 960px) {
    .auth-wrap {
        grid-template-columns: 1.05fr 1fr;
        padding: 0;
        gap: 0;
        place-items: stretch;
    }
}

/* Panel lateral decorativo (solo escritorio) */
.auth-side {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 60px;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 30% 20%, rgba(225,6,0,0.35), transparent 60%),
        linear-gradient(160deg, #150000, #0A0A0C 70%);
    border-right: 1px solid var(--border);
}

@media (min-width: 960px) {
    .auth-side { display: flex; }
}

.auth-side .brand-quote {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-top: auto;
    margin-bottom: 20px;
}

.auth-side .brand-quote .accent {
    background: linear-gradient(135deg, var(--red-light), var(--red-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-side .brand-sub {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 40px;
}

.auth-side .feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.auth-side .chip {
    padding: 8px 14px;
    border-radius: 100px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-strong);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-side .chip .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--red-light);
    box-shadow: 0 0 8px var(--red-light);
}

/* Panel del formulario */
.auth-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 12px;
}

@media (min-width: 960px) {
    .auth-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 60px 80px;
        max-width: 100%;
    }
}

.auth-header {
    margin-bottom: 32px;
}
.auth-header .logo {
    margin-bottom: 32px;
}
.auth-header h1 {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.auth-header p {
    color: var(--text-dim);
    font-size: 0.98rem;
}
.auth-header p a {
    color: var(--red-light);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s var(--ease);
}
.auth-header p a:hover { border-bottom-color: var(--red-light); }

/* Formulario */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}
.form-label .req { color: var(--red-light); }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .icon-left {
    position: absolute;
    left: 16px;
    width: 18px; height: 18px;
    color: var(--text-dimmer);
    pointer-events: none;
    transition: color 0.2s var(--ease);
}
.input-wrap .icon-left svg {
    width: 100%; height: 100%;
    stroke: currentColor; fill: none;
    stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

.form-input {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 14px 16px 14px 46px;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
    outline: none;
}
.form-input.no-icon { padding-left: 16px; }
.form-input::placeholder { color: var(--text-dimmer); }
.form-input:focus {
    border-color: var(--red);
    background: #18181D;
    box-shadow: 0 0 0 3px var(--red-soft);
}
.form-input:focus ~ .icon-left,
.input-wrap:focus-within .icon-left { color: var(--red-light); }

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}
.form-input.success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}

/* Password toggle */
.pw-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    color: var(--text-dimmer);
    border-radius: 8px;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.pw-toggle:hover { color: var(--text); background: var(--bg-card); }
.pw-toggle svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

/* Medidor de fuerza */
.pw-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.pw-strength .bar {
    flex: 1;
    height: 4px;
    background: var(--border-strong);
    border-radius: 100px;
    transition: background 0.3s var(--ease);
}
.pw-strength[data-score="1"] .bar:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-score="2"] .bar:nth-child(-n+2) { background: var(--warning); }
.pw-strength[data-score="3"] .bar:nth-child(-n+3) { background: #FACC15; }
.pw-strength[data-score="4"] .bar:nth-child(-n+4) { background: var(--success); }

.pw-hint {
    font-size: 0.78rem;
    color: var(--text-dimmer);
    margin-top: 6px;
    min-height: 16px;
}

/* Errores de campo */
.field-error {
    display: none;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 6px;
    align-items: center;
    gap: 5px;
}
.field-error.show { display: flex; }
.field-error svg {
    width: 14px; height: 14px;
    stroke: currentColor; fill: none;
    stroke-width: 2.2;
    stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

/* Alertas generales */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeUp 0.35s var(--ease);
    line-height: 1.5;
}
.alert svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke: currentColor; fill: none;
    stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #FCA5A5;
}
.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #86EFAC;
}
.alert-info {
    background: var(--red-soft);
    border: 1px solid rgba(225,6,0,0.3);
    color: #FCA5A5;
}

/* Términos */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 22px;
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}
.terms-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-soft);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s var(--ease);
    position: relative;
}
.terms-check input:checked {
    background: var(--red);
    border-color: var(--red);
}
.terms-check input:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.terms-check a { color: var(--red-light); text-decoration: none; }
.terms-check a:hover { text-decoration: underline; }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-dimmer);
    font-size: 0.8rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-strong);
}

/* Footer del form */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-dimmer);
}
.auth-footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}
.auth-footer a:hover { color: var(--red-light); }

/* Estado de carga del botón */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Barra de progreso del formulario (arriba) */
.form-progress {
    height: 3px;
    background: var(--border);
    border-radius: 100px;
    margin-bottom: 28px;
    overflow: hidden;
}
.form-progress .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--red-light), var(--red));
    border-radius: 100px;
    transition: width 0.5s var(--ease);
}
/* ==========================================================
   LOGIN — Extras
========================================================== */
.login-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.login-extras .terms-check {
    margin: 0;
    font-size: 0.85rem;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--red-light);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s var(--ease);
}
.forgot-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 400px) {
    .login-extras {
        flex-direction: column;
        align-items: flex-start;
    }
}
@media (max-width: 500px) {
    .auth-header h1 { font-size: 1.5rem; }
    .form-input { font-size: 16px; } /* evita zoom automático en iOS */
}