/* ===================================================
   NUTRIENDO FUTURO — Login
   Estilo: Moderno/Minimalista coherente con el panel
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

:root {
    --primary: #3b6ff5;
    --primary-light: #e8efff;
    --primary-lighter: #f0f5ff;
    --primary-dark: #2b54c5;
    --primary-muted: #96b3f6;
    --bg-body: #f4f7fc;
    --bg-card: #ffffff;
    --bg-input: #f9fbff;
    --border: #dfe6f2;
    --border-light: #e8edf8;
    --text-primary: #1a2a44;
    --text-secondary: #5e6e87;
    --text-tertiary: #8896ab;
    --text-on-primary: #ffffff;
    --danger: #ef5350;
    --danger-bg: #ffeaea;
    --danger-text: #c62828;
    --success: #22b573;
    --success-bg: #e6f9ef;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ===== BACK TO HOME ===== */
.login-back-home {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 6px 20px rgba(59, 111, 245, 0.12);
    transition: var(--transition);
    z-index: 10;
}

.login-back-home i {
    font-size: 1rem;
    color: var(--primary);
}

.login-back-home:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(59, 111, 245, 0.18);
}

/* ===== LAYOUT ===== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== BRANDING (Izquierda) ===== */
.login-branding {
    flex: 0 0 44%;
    background: linear-gradient(145deg, #3b6ff5 0%, #2b54c5 50%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.branding-content {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    background: white;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -120px;
    right: -80px;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-2 {
    width: 250px;
    height: 250px;
    bottom: -60px;
    left: -40px;
    animation: floatShape 15s ease-in-out infinite reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape 12s ease-in-out infinite 2s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.brand-logo {
    margin-bottom: 2rem;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon i {
    font-size: 1.75rem;
    color: white;
}

.brand-logo h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.brand-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-item i {
    font-size: 1.15rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

/* ===== FORMULARIO (Derecha) ===== */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-body);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

/* Logo mobile */
.mobile-logo {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-icon-sm {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-sm i {
    color: white;
    font-size: 1.1rem;
}

.mobile-logo span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== FORM HEADER ===== */
.form-header {
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.form-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== ALERTS ===== */
.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(239, 83, 80, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.alert-danger i {
    color: var(--danger);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.form-label i {
    color: var(--primary-muted);
    font-size: 0.85rem;
}

.input-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
    font-size: 0.84rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 111, 245, 0.1);
    background: white;
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.1);
}

/* Toggle password */
.password-wrapper .form-control {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password i {
    font-size: 1.1rem;
}

/* ===== BOTÓN LOGIN ===== */
.btn-login {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(59, 111, 245, 0.3);
}

.btn-login:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(59, 111, 245, 0.4);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* ===== FOOTER ===== */
.form-footer {
    margin-top: 2.5rem;
    text-align: center;
}

.form-footer p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ===== MODAL: Cambiar contraseña (primer login) ===== */
.modal-content {
    border-radius: var(--radius-lg) !important;
    border: none;
    box-shadow: 0 8px 30px rgba(59, 111, 245, 0.1);
    overflow: hidden;
}

.modal-header {
    background: var(--primary) !important;
    color: white;
    border-bottom: none;
    padding: 1.1rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: #f8faff;
}

.primer-login-info {
    text-align: center;
    padding: 1rem 0.5rem 1.5rem;
}

.primer-login-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.primer-login-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.primer-login-info h6 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.primer-login-info p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 0;
}

/* ===== ANIMACIONES ===== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-form-container {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.branding-content {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
    opacity: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .login-branding {
        display: none;
    }

    .login-back-home {
        display: none;
    }

    .login-form-panel {
        padding: 2rem 1.5rem;
    }

    .mobile-logo {
        display: flex;
    }

    .form-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .login-form-panel {
        padding: 1.5rem 1.25rem;
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ===== FOOTER LITE ===== */
.nf-footer-lite {
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
}

.nf-footer-lite-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.nf-footer-lite-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nf-footer-lite-brand img {
    height: 26px;
    width: auto;
}

.nf-footer-lite-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.nf-footer-dot {
    color: var(--text-tertiary);
}

.nf-footer-lite-copy {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .nf-footer-lite-inner {
        padding: 0 1rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.4rem;
    }
    .nf-footer-lite-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nf-footer-lite-brand {
        justify-content: center;
    }
}
