/* ============================================
   GESTOR - Login Page Redesign
   Split layout with news panel
   ============================================ */

:root {
    --gestor-primary: #164194;
    --gestor-primary-dark: #0f2f6e;
    --gestor-primary-darker: #0a1f4a;
    --gestor-bg-light: #eef2f3;
    --gestor-text-dark: #1a2332;
    --gestor-text-muted: #6b7a8d;
    --gestor-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --gestor-input-border: #c8d0d8;
    --gestor-input-focus: #164194;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body.login-page {
    background: var(--gestor-bg-light) !important;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* ---- Main Split Container ---- */
.login-split-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ---- LEFT PANEL: Login Form ---- */
.login-panel-left {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 3rem;
    background: var(--gestor-bg-light);
    position: relative;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo img {
    height: 52px;
    width: auto;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gestor-text-dark);
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-greeting {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gestor-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.3px;
}

/* ---- Form Fields ---- */
.login-field-group {
    margin-bottom: 1.25rem;
}

.login-field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gestor-text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field-group .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--gestor-input-border);
    border-radius: 8px;
    background: #fff;
    color: var(--gestor-text-dark);
    transition: all 0.25s ease;
}

.login-field-group .form-control:focus {
    outline: none;
    border-color: var(--gestor-input-focus);
    box-shadow: 0 0 0 3px rgba(13, 123, 106, 0.12);
}

.login-field-group .form-control::placeholder {
    color: #a8b5c2;
    font-weight: 400;
}

/* Password wrapper */
.login-password-wrapper {
    position: relative;
}

.login-password-wrapper .form-control {
    padding-right: 2.8rem;
}

.login-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gestor-text-muted);
    font-size: 1.05rem;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
}

.login-toggle-pw:hover {
    color: var(--gestor-primary);
}

/* Forgot password link */
.login-forgot-link {
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.login-forgot-link a {
    font-size: 0.82rem;
    color: var(--gestor-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-forgot-link a:hover {
    color: var(--gestor-primary-dark);
    text-decoration: underline;
}

/* Submit Button */
.login-btn-submit {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--gestor-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(22, 65, 148, 0.3);
}

.login-btn-submit:hover {
    background: var(--gestor-primary-dark);
    box-shadow: 0 6px 20px rgba(22, 65, 148, 0.4);
    transform: translateY(-1px);
}

.login-btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 65, 148, 0.3);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--gestor-text-muted);
}

.login-footer a {
    color: var(--gestor-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ---- FIEMA Logo in right panel ---- */
.fiema-logo-wrapper {
    margin-bottom: 2rem;
}

.fiema-logo-img {
    height: 130px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* ---- Feature Cards ---- */
.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
    text-align: left;
    max-width: 480px;
}

.login-feature-more {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.login-feature-more .login-feature-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #bfdbfe;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    transition: all 0.3s ease;
}

.login-feature-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.login-feature-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #93c5fd;
}

.login-feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.login-feature-text strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.login-feature-text span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* ---- RIGHT PANEL: Institucional FIEMA ---- */
.login-panel-right {
    flex: 1;
    background: linear-gradient(160deg, #1d4faa 0%, #164194 30%, #0d2a63 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    text-align: center;
}

/* Decorative background shapes */
.login-panel-right::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    top: -150px;
    right: -100px;
}

.login-panel-right::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.025);
    bottom: -100px;
    left: -80px;
}

/* Diamond decoration */
.login-diamond-deco {
    position: absolute;
    bottom: 60px;
    right: 60px;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(255,255,255,0.07);
    transform: rotate(45deg);
    border-radius: 20px;
}

.login-diamond-deco::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(255,255,255,0.05);
    border-radius: 15px;
}

.news-content {
    position: relative;
    z-index: 2;
    max-width: 460px;
}

.news-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.news-subtitle {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-weight: 400;
}

/* News Icon / Illustration */
.news-illustration {
    margin-bottom: 2rem;
    position: relative;
}

.news-icon-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
}

.news-icon-circle i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.news-badge {
    position: absolute;
    top: -5px;
    right: calc(50% - 100px);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.news-description {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.news-btn {
    display: inline-block;
    padding: 0.75rem 2.5rem;
    background: #fff;
    color: #164194;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
}

.news-btn:hover {
    background: #e0e7ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.35);
    color: #164194;
    text-decoration: none;
}

/* ---- Alert Messages ---- */
.login-alert {
    margin-bottom: 1.25rem;
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0.75rem 1rem;
    border: none;
}

.login-alert.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.login-alert.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid #22c55e;
}

/* ---- Forgot Password Modal (Redesigned) ---- */
.modal-forgot .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.modal-forgot .modal-header {
    background: linear-gradient(135deg, #164194 0%, #0d2a63 100%);
    border: none;
    padding: 1.5rem 2rem;
    position: relative;
}

.modal-forgot .modal-header::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.modal-forgot .modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}

.modal-forgot .modal-title i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.modal-forgot .btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.modal-forgot .btn-close-white:hover {
    opacity: 1;
}

.modal-forgot .modal-body {
    padding: 2rem;
}

.modal-forgot .modal-body .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gestor-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.modal-forgot .modal-body .form-control {
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--gestor-input-border);
    border-radius: 8px;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.modal-forgot .modal-body .form-control:focus {
    border-color: var(--gestor-primary);
    box-shadow: 0 0 0 3px rgba(13, 123, 106, 0.12);
}

.modal-forgot .modal-footer {
    border: none;
    padding: 0 2rem 1.5rem;
    gap: 0.75rem;
}

.modal-forgot .btn-cancel {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    background: #f1f5f9;
    color: var(--gestor-text-muted);
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
}

.modal-forgot .btn-cancel:hover {
    background: #e2e8f0;
    color: var(--gestor-text-dark);
}

.modal-forgot .btn-save {
    padding: 0.6rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    background: var(--gestor-primary);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 65, 148, 0.25);
}

.modal-forgot .btn-save:hover {
    background: var(--gestor-primary-dark);
    box-shadow: 0 6px 18px rgba(22, 65, 148, 0.35);
    transform: translateY(-1px);
}

.forgot-info-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #bfdbfe;
}

.forgot-info-box i {
    color: var(--gestor-primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.forgot-info-box p {
    margin: 0;
    font-size: 0.85rem;
    color: #1e3a5f;
    line-height: 1.5;
}

/* Password strength indicator */
.password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.password-rule {
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    background: #f1f5f9;
    color: var(--gestor-text-muted);
    font-weight: 600;
}

.password-rule.valid {
    background: #dcfce7;
    color: #166534;
}

/* ---- Email Sending Modal ---- */
.modal-email-sending .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal-email-sending .modal-body {
    padding: 2.5rem 2rem;
}

.modal-email-sending .sending-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #164194, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: pulse-send 2s ease-in-out infinite;
}

.modal-email-sending .sending-icon i {
    font-size: 2rem;
    color: #fff;
}

.modal-email-sending h5 {
    font-weight: 700;
    color: var(--gestor-text-dark);
    margin-bottom: 0.5rem;
}

.modal-email-sending p {
    color: var(--gestor-text-muted);
    font-size: 0.9rem;
}

@keyframes pulse-send {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

/* ---- Honeypot (hidden field) ---- */
.login-honey {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991px) {
    .login-split-container {
        flex-direction: column;
    }

    .login-panel-left {
        flex: none;
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    body.login-page {
        overflow: auto;
    }

    html, body {
        overflow: auto;
    }

    .login-panel-right {
        flex: none;
        padding: 2.5rem 1.5rem;
        min-height: 400px;
    }

    .news-title {
        font-size: 1.5rem;
    }

    .login-diamond-deco {
        display: none;
    }

    .login-features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .login-panel-left {
        padding: 1.5rem 1.25rem;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .login-title {
        font-size: 1.3rem;
    }

    .news-icon-circle {
        width: 100px;
        height: 100px;
    }

    .news-icon-circle i {
        font-size: 2.5rem;
    }

    .login-features {
        grid-template-columns: 1fr;
    }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

.news-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}
