/* ============================================
   Auth Pages (Login, Registro, Recuperar)
   ============================================ */
.auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    padding: 48px 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(2, 40, 89, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(2, 40, 89, 0.04) 0%, transparent 50%),
        var(--onos-body-bg);
}

.auth-container {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* Card principal */
.auth-card {
    background: var(--onos-card-bg);
    border-radius: 16px;
    border: 1px solid var(--onos-border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header con fondo oscuro */
.auth-header {
    background: var(--onos-dark);
    padding: 36px 32px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(2, 40, 89, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
    position: relative;
    border-radius: 8px;
}

.auth-title {
    color: var(--onos-text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
}

.auth-subtitle {
    color: var(--onos-text-muted);
    font-size: 0.88rem;
    margin-bottom: 0;
    position: relative;
}

/* Body del form */
.auth-body {
    padding: 32px;
}

/* Input groups */
.auth-input-group {
    margin-bottom: 20px;
    position: relative;
}

.auth-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--onos-text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.auth-input-group label i {
    color: var(--onos-primary);
    margin-right: 4px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--onos-border);
    border-radius: var(--onos-radius);
    font-size: 0.95rem;
    color: var(--onos-text-dark);
    background-color: #f8f9fa;
    transition: var(--onos-transition);
}

.auth-input::placeholder {
    color: #adb5bd;
}

.auth-input:focus {
    outline: none;
    border-color: var(--onos-primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(2, 40, 89, 0.1);
}

.auth-input.is-invalid {
    border-color: #dc3545;
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.auth-input.is-valid {
    border-color: #198754;
}

/* Password toggle */
.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 48px;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
    transition: var(--onos-transition);
}

.auth-password-toggle:hover {
    color: var(--onos-primary);
}

/* Row para nombre/apellido */
.auth-row {
    display: flex;
    gap: 16px;
}

.auth-row .auth-input-group {
    flex: 1;
}

/* Validation feedback */
.auth-feedback {
    font-size: 0.78rem;
    color: #dc3545;
    margin-top: 4px;
    display: none;
}

.auth-input.is-invalid ~ .auth-feedback {
    display: block;
}

.form-check-input.is-invalid {
    border-color: #dc3545;
}

.form-check:has(> .form-check-input.is-invalid) + .auth-feedback {
    display: block;
}

/* Links */
.auth-forgot {
    display: block;
    text-align: right;
    font-size: 0.83rem;
    color: var(--onos-primary);
    margin-top: -8px;
    margin-bottom: 24px;
    transition: var(--onos-transition);
}

.auth-forgot:hover {
    color: var(--onos-primary-hover);
    text-decoration: underline;
}

/* Submit button */
.auth-submit {
    width: 100%;
    padding: 14px;
    background: var(--onos-primary);
    color: white;
    border: none;
    border-radius: var(--onos-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--onos-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.auth-submit:hover {
    background: var(--onos-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 40, 89, 0.3);
}

.auth-submit:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #adb5bd;
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--onos-border);
}

/* Footer del card */
.auth-footer {
    text-align: center;
    padding: 20px 32px;
    border-top: 1px solid var(--onos-border);
    background-color: #fafbfc;
}

.auth-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.auth-footer a {
    color: var(--onos-primary);
    font-weight: 600;
    transition: var(--onos-transition);
}

.auth-footer a:hover {
    color: var(--onos-primary-hover);
    text-decoration: underline;
}

/* Alert de respuesta server */
.auth-alert {
    padding: 12px 16px;
    border-radius: var(--onos-radius);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-alert-error {
    background-color: #fef2f2;
    color: #dc3545;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background-color: #f0fdf4;
    color: #198754;
    border: 1px solid #bbf7d0;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablets */
@media (max-width: 768px) {
    .auth-section {
        padding: 32px 0;
        min-height: auto;
    }

    .auth-container {
        max-width: 440px;
    }

    .auth-header {
        padding: 30px 28px 24px;
    }

    .auth-body {
        padding: 28px;
    }

    .auth-submit {
        padding: 13px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .auth-section {
        padding: 16px 0;
        align-items: flex-start;
    }

    .auth-container {
        max-width: 100%;
        padding: 0 4px;
    }

    .auth-card {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    .auth-header {
        padding: 24px 20px 20px;
    }

    .auth-logo {
        width: 64px;
        margin-bottom: 12px;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .auth-subtitle {
        font-size: 0.82rem;
    }

    .auth-body {
        padding: 20px;
    }

    .auth-input-group {
        margin-bottom: 16px;
    }

    .auth-input-group label {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    .auth-input {
        padding: 11px 14px;
        font-size: 0.9rem;
    }

    .auth-password-wrap .auth-input {
        padding-right: 44px;
    }

    .auth-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-submit {
        padding: 12px;
        font-size: 0.95rem;
    }

    .auth-forgot {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    .auth-footer {
        padding: 16px 20px;
    }

    .auth-footer p {
        font-size: 0.85rem;
    }

    .auth-divider {
        margin: 20px 0;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .auth-header {
        padding: 20px 16px 16px;
    }

    .auth-body {
        padding: 16px;
    }

    .auth-title {
        font-size: 1.15rem;
    }

    .auth-input {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .auth-footer {
        padding: 14px 16px;
    }
}
