/* SIGEFRO — Login page */

:root {
    --sigefro-blue: #0245b9;
    --sigefro-blue-dark: #0030b9;
    --sigefro-blue-darker: #002399;
    --sigefro-blue-light: #3d6fd4;
    --sigefro-surface: #f4f7fc;
    --sigefro-text: #1a2332;
    --sigefro-muted: #5c6b82;
    --sigefro-border: #d8e0ef;
    --sigefro-radius: 16px;
    --sigefro-shadow: 0 24px 48px rgba(2, 69, 185, 0.12), 0 8px 16px rgba(26, 35, 50, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.login-page {
    margin: 0;
    min-height: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--sigefro-text);
    background: var(--sigefro-surface);
    -webkit-font-smoothing: antialiased;
}

.login-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Brand panel (left) ── */

.login-brand {
    position: relative;
    flex: 1 1 48%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    background: linear-gradient(145deg, var(--sigefro-blue) 0%, var(--sigefro-blue-dark) 45%, var(--sigefro-blue-darker) 100%);
    color: #fff;
    overflow: hidden;
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.login-brand::after {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-brand-logo {
    display: block;
    max-width: 220px;
    height: auto;
    margin-bottom: 2rem;
}

.login-brand h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.login-brand-tagline {
    margin: 0 0 2.5rem;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 400;
}

.login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.login-features li i {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.75rem;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ── Form panel (right) ── */

.login-form-panel {
    flex: 1 1 52%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--sigefro-radius);
    box-shadow: var(--sigefro-shadow);
    padding: 2.5rem 2.25rem;
}

.login-card-header {
    margin-bottom: 1.75rem;
}

.login-card-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sigefro-text);
}

.login-card-header p {
    margin: 0;
    color: var(--sigefro-muted);
    font-size: 0.95rem;
}

/* Mobile brand strip */
.login-mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-mobile-brand img {
    max-height: 44px;
    width: auto;
}

/* ── Alerts & errors ── */

.login-messages {
    margin-bottom: 1.25rem;
}

.login-messages .alert {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 10px;
}

.login-messages .alert:last-child {
    margin-bottom: 0;
}

.login-messages .alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.login-messages .alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.login-messages .alert-info {
    background: #eff6ff;
    color: #1e40af;
}

.login-form-errors {
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Form fields ── */

.login-field {
    margin-bottom: 1.15rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sigefro-text);
}

.login-field label .required {
    color: #dc2626;
    margin-left: 2px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap .field-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sigefro-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.8rem 0.95rem 0.8rem 2.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--sigefro-text);
    background: #fff;
    border: 1.5px solid var(--sigefro-border);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap input::placeholder {
    color: #9ca8ba;
}

.login-input-wrap input:hover {
    border-color: #b8c5da;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--sigefro-blue);
    box-shadow: 0 0 0 3px rgba(2, 69, 185, 0.15);
}

.login-input-wrap.has-toggle input {
    padding-right: 2.75rem;
}

.login-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--sigefro-muted);
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.login-toggle-password:hover {
    color: var(--sigefro-blue);
}

.login-toggle-password:focus-visible {
    outline: 2px solid var(--sigefro-blue);
    outline-offset: 2px;
}

/* ── Submit button ── */

.login-submit-wrap .login-submit {
    margin-top: 0;
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, var(--sigefro-blue) 0%, var(--sigefro-blue-dark) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 12px rgba(2, 69, 185, 0.3);
}

.login-submit:hover {
    background: linear-gradient(180deg, var(--sigefro-blue-light) 0%, var(--sigefro-blue) 100%);
    box-shadow: 0 6px 16px rgba(2, 69, 185, 0.35);
}

.login-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(2, 69, 185, 0.25);
}

.login-submit:focus-visible {
    outline: 2px solid var(--sigefro-blue);
    outline-offset: 3px;
}

.login-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Footer links ── */

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--sigefro-border);
    font-size: 0.875rem;
}

.login-links a {
    color: var(--sigefro-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.login-links a:hover {
    color: var(--sigefro-blue-darker);
    text-decoration: underline;
}

.login-links a:focus-visible {
    outline: 2px solid var(--sigefro-blue);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Responsive ── */

@media (max-width: 991.98px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand {
        display: none;
    }

    .login-mobile-brand {
        display: block;
    }

    .login-form-panel {
        flex: 1;
        padding: 2rem 1.25rem;
        background: linear-gradient(180deg, var(--sigefro-blue) 0%, var(--sigefro-blue-dark) 120px, var(--sigefro-surface) 120px);
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 479.98px) {
    .login-links {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

/* ── Cadastro (auth pages shared) ── */

.login-card-wide {
    max-width: 480px;
}

.login-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.login-field-row .login-field {
    margin-bottom: 1.15rem;
}

.login-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 1.25rem 0 0.5rem;
    font-size: 0.875rem;
    color: var(--sigefro-muted);
    line-height: 1.45;
}

.login-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    accent-color: var(--sigefro-blue);
}

.login-checkbox a {
    color: var(--sigefro-blue);
    text-decoration: none;
    font-weight: 500;
}

.login-checkbox a:hover {
    text-decoration: underline;
}

.login-terms-group {
    margin-bottom: 0.25rem;
}

.login-terms-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.35rem 0 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--sigefro-blue);
    background: rgba(2, 69, 185, 0.06);
    border: 1px solid rgba(2, 69, 185, 0.15);
    border-radius: 8px;
}

.login-terms-hint i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

.login-terms-hint--emphasis {
    background: rgba(2, 69, 185, 0.1);
    border-color: rgba(2, 69, 185, 0.28);
}

.login-checkbox.login-checkbox--attention {
    padding: 0.55rem 0.65rem;
    margin-left: -0.65rem;
    margin-right: -0.65rem;
    border-radius: 10px;
    background: rgba(2, 69, 185, 0.04);
    animation: login-terms-pulse 2.8s ease-in-out infinite;
}

@keyframes login-terms-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(2, 69, 185, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(2, 69, 185, 0.14);
    }
}

.login-submit-wrap {
    margin-top: 0.5rem;
}

.login-submit-wrap.is-disabled {
    cursor: not-allowed;
}

.login-submit-wrap.is-disabled .login-submit {
    pointer-events: none;
}

.login-submit-hint {
    margin: 0.55rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: center;
    color: var(--sigefro-muted);
}

.login-error-list {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.login-error-list li {
    margin-bottom: 0.25rem;
}

.login-links-centered {
    justify-content: center;
}

@media (max-width: 575.98px) {
    .login-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .login-card-wide {
        max-width: 420px;
    }
}
