/* =========================================
   LOGIN.CSS - Vista de Iniciar Sesión
   ========================================= */

/* ─── Layout base ─── */
.auth-body {
    background: var(--bg-main);
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(68px + 2.5rem) 5% 3rem;
    min-height: 100vh;
}

.login-container {
    background-color: #ffffff;
    width: 100%;
    max-width: 980px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    overflow: hidden;
}

/* ─── Branding ─── */
.login-branding {
    background: linear-gradient(145deg, #1c2e28 0%, #2d4a3e 60%, #3d6b55 100%);
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(61, 155, 122, 0.12);
    top: -80px;
    right: -80px;
}

.login-branding::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(240, 200, 122, 0.08);
    bottom: -40px;
    left: -40px;
}

.branding-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(61, 155, 122, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(61, 155, 122, 0.3);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
    width: fit-content;
}

.login-branding h2 {
    font-size: 2rem;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 700;
}

.login-branding h2 em {
    font-style: italic;
    color: var(--primary-light);
}

.login-branding p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(232, 240, 236, 0.8);
    margin-bottom: 2.5rem;
}

.branding-stats {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stat-item strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
    line-height: 1;
}

.stat-item span {
    font-size: 0.78rem;
    color: rgba(232, 240, 236, 0.7);
    display: block;
    margin-top: 3px;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
}

.branding-testimonial {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}

.branding-testimonial p {
    font-size: 0.9rem;
    color: rgba(232, 240, 236, 0.9);
    line-height: 1.55;
    margin-bottom: 1rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    font-size: 0.85rem;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
}

.testimonial-author span {
    font-size: 0.78rem;
    color: rgba(232, 240, 236, 0.65);
}

/* ─── Formulario ─── */
.login-form-section {
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.85rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Input groups ─── */
.input-group {
    margin-bottom: 1.25rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.forgot-password {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
}

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

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

.input-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 46px 13px 42px;
    background: var(--bg-main);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(61, 155, 122, 0.1);
}

.input-wrapper input::placeholder { color: var(--text-muted); opacity: 0.7; }

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.toggle-password svg { width: 18px; height: 18px; }
.toggle-password:hover { color: var(--text-dark); }

/* ─── Checkbox recordar ─── */
.remember-row {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-body);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* ─── Botón full width ─── */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* ─── Divider ─── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

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

/* ─── OAuth ─── */
.oauth-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.btn-oauth:hover {
    background: var(--bg-main);
    border-color: rgba(61, 155, 122, 0.3);
    box-shadow: var(--shadow-sm);
}

/* ─── Footer ─── */
.form-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a { font-weight: 600; color: var(--primary); }
.form-footer a:hover { color: var(--primary-dark); }

/* ─── Error Messages & Validation ─── */
.input-error {
    display: block;
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 6px;
    font-weight: 500;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input.is-invalid {
    border-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.02);
}

input.is-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#email-errors,
#password-errors {
    min-height: 24px;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .login-branding {
        padding: 2.5rem 2rem;
    }

    .branding-stats {
        justify-content: center;
    }

    .login-form-section {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 520px) {
    .login-wrapper {
        padding: calc(68px + 1.5rem) 4% 2rem;
    }

    .login-form-section {
        padding: 2rem 1.5rem;
    }

    .oauth-buttons {
        grid-template-columns: 1fr;
    }
}
