/* Login — fondo con imagen marca */
body.page-login {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    padding: 1.5rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(3.5rem, calc(2rem + env(safe-area-inset-bottom)));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2c3338;
    background-color: #eef6f0;
}

.login-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-color: #eef6f0;
    background-image: var(--login-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(238, 246, 240, 0.42);
}

.login-scene::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2;
    background: linear-gradient(90deg, #057a1c 0%, #069e23 50%, #0bb52f 100%);
}

.login-wrap {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 400px;
    margin-top: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem 1.85rem 1.65rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 12px 32px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.login-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef0f2;
}

.brand-login-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: inline-block;
}

.login-logo-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.login-title {
    margin: 0 0 1.25rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.login-alert-slot {
    margin: 0;
    padding: 0;
}

.login-alert-slot:empty {
    display: none;
}

.login-alert-slot:not(:empty) {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    margin-bottom: 0.75rem;
}

.login-alert-slot .login-alert {
    width: 100%;
    margin: 0;
}

.login-alert {
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.login-alert--error {
    background: #fef2f2;
    border: 1px solid #f87171;
    color: #b91c1c;
}

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

.login-alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.login-field {
    margin-bottom: 1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.page-login .form-control {
    width: 100%;
    background: #fff;
    border: 1.5px solid #9ca3af;
    border-radius: 8px;
    color: #111827;
    min-height: 44px;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap--icon .form-control {
    padding-left: 2.5rem;
}

.page-login .form-control:hover {
    border-color: #6b7280;
}

.page-login .form-control:focus {
    border-color: #069e23;
    box-shadow:
        inset 0 1px 2px rgba(15, 23, 42, 0.04),
        0 0 0 3px rgba(6, 158, 35, 0.18);
    outline: none;
}

.page-login .form-control::placeholder {
    color: #9ca3af;
}

.page-login .form-control.is-invalid {
    border-color: #dc2626;
    box-shadow:
        inset 0 1px 2px rgba(220, 38, 38, 0.06),
        0 0 0 3px rgba(220, 38, 38, 0.12);
}

.password-input-wrap .form-control {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    line-height: 36px;
    text-align: center;
    z-index: 2;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: #069e23;
    background: #f3f4f6;
    outline: none;
}

.password-toggle-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(6, 158, 35, 0.35);
}

.btn-login-primary {
    width: 100%;
    min-height: 46px;
    margin-top: 0.5rem;
    border: none;
    border-radius: 8px;
    background: #069e23;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    box-shadow: 0 2px 6px rgba(6, 158, 35, 0.28);
}

.btn-login-primary:hover:not(:disabled) {
    background: #057a1c;
    box-shadow: 0 4px 12px rgba(6, 158, 35, 0.35);
}

.btn-login-primary:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(6, 158, 35, 0.25);
}

.btn-login-primary:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 5px rgba(6, 158, 35, 0.55);
}

.btn-login-primary:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    box-shadow: none;
}

.login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0.85rem 1rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    text-align: center;
    pointer-events: none;
}

.login-footer__text {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.login-btn-loading {
    display: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.login-btn-loading .fa {
    margin-right: 0.35rem;
}

.login-form.is-loading .login-btn-label {
    visibility: hidden;
}

.login-form.is-loading .login-btn-loading {
    display: inline-flex;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 575.98px) {
    body.page-login {
        padding: 1rem;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(3rem, calc(1.5rem + env(safe-area-inset-bottom)));
        background-color: #eef0f2;
    }

    .login-scene {
        background-color: #eef0f2;
        background-size: contain;
        background-position: center center;
    }

    .login-scene::after {
        background: rgba(238, 246, 240, 0.42);
    }

    .login-card {
        padding: 1.65rem 1.35rem 1.4rem;
    }

    .brand-login-logo {
        max-width: 250px;
    }
}
