/*
 * UI-LOGIN-001 — CSS de login portado do helpdesk OAB/DF
 * Fonte visual: layout institucional OAB/DF (CSS consolidado no repositório)
 * Escopo: somente autenticação SentinelRMM — sem integração do backend helpdesk.
 *
 * Personalização:
 *   --brand-navy, --primary, --brand-gold
 *   --login-logo-url (futuro logotipo no .brand-mark)
 */

:root {
    --bg: #f3f6fb;
    --surface: #fff;
    --text: #172033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #1d4ed8;
    --primary-2: #2563eb;
    --brand-navy: #0c1f3f;
    --brand-navy-2: #132d5c;
    --brand-gold: #c9a227;
    --radius: 18px;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --font-sans: "Inter", Segoe UI, system-ui, sans-serif;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
    --login-logo-url: none;
}

html[data-bs-theme="dark"] {
    --surface: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #334155;
    --bg: #0b1220;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color: var(--text);
    background:
        radial-gradient(ellipse 120% 80% at 10% 0%, #1e40af 0%, transparent 50%),
        linear-gradient(145deg, #07111f 0%, #0f2744 42%, #1e3a8a 100%);
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-shell {
    width: 100%;
    max-width: 1140px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    animation: login-rise 0.5s ease-out both;
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Painel esquerdo */
.login-brand {
    padding: 48px 52px;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        linear-gradient(155deg, #0a355f 0%, #124f8a 52%, #1769ad 100%);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bfdbfe;
    background-image: var(--login-logo-url);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 36px;
    padding-left: var(--login-logo-url, 0);
}

.brand-org {
    color: #fff;
    font-size: 15px;
}

.brand-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.25);
}

.brand-unit {
    color: #93c5fd;
}

.brand-badge {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 9px 14px;
    border-radius: 999px;
    margin-bottom: 28px;
    font-size: 13px;
    font-weight: 700;
    color: #dbeafe;
}

.login-brand h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin: 0 0 16px;
}

.brand-lead {
    font-size: 16px;
    line-height: 1.65;
    color: #cbd5e1;
    max-width: 560px;
    margin: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 34px;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 16px;
    transition: transform 0.18s ease, background 0.18s ease;
}

.feature:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.feature strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.feature span {
    font-size: 13px;
    color: #dbeafe;
    line-height: 1.45;
}

/* Painel direito */
.login-card {
    background: var(--surface);
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card-header {
    margin-bottom: 28px;
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-navy);
    margin: 0 0 8px;
}

html[data-bs-theme="dark"] .login-card h2 {
    color: #f1f5f9;
}

.login-card-header p {
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.login-alert {
    border-radius: 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 7px;
}

html[data-bs-theme="dark"] .field label {
    color: #cbd5e1;
}

.field input {
    width: 100%;
    border: 1px solid #d7dce5;
    border-radius: 14px;
    padding: 13px 14px;
    background: var(--surface);
    outline: none;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    border-color: #2563eb;
    box-shadow: var(--focus-ring);
}

.field input.is-invalid {
    border-color: #dc2626;
}

.field input.is-valid {
    border-color: #16a34a;
}

.field .invalid-feedback {
    display: none;
    font-size: 12px;
    color: #dc2626;
    margin-top: 6px;
}

.was-validated .field input:invalid ~ .invalid-feedback,
.was-validated .field:has(input:invalid) .invalid-feedback,
.field input.is-invalid ~ .invalid-feedback {
    display: block;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 48px;
}

.login-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.login-toggle-password:hover {
    background: #f1f5f9;
    color: #334155;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 13px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    padding: 12px 16px;
    cursor: pointer;
    transition: 0.18s;
    text-decoration: none;
    font-size: 14px;
}

.btn:hover {
    background: #173ea8;
    transform: translateY(-1px);
    color: #fff;
}

.btn.secondary {
    background: #111827;
}

.btn.block {
    width: 100%;
}

.btn-login {
    height: 48px;
    font-size: 15px;
    letter-spacing: 0.01em;
    margin-top: 8px;
}

.btn-login.is-loading {
    pointer-events: none;
    opacity: 0.92;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hint {
    margin-top: 16px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.login-link {
    color: var(--primary-2);
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

.login-link-sep {
    color: #94a3b8;
}

.login-meta {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.login-sso {
    margin-bottom: 8px;
}

.login-sso-label {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.login-sso-actions {
    display: grid;
    gap: 8px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 8px;
    color: var(--muted);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Forgot password */
.auth-simple-card {
    width: min(440px, 100%);
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    padding: 44px 48px;
    animation: login-rise 0.45s ease-out both;
}

.auth-simple-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-navy);
}

@media (max-width: 1100px) {
    .login-brand {
        padding: 36px 32px 24px;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    body.login-body {
        padding: 16px;
    }

    .login-card,
    .login-brand {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell,
    .auth-simple-card,
    .feature,
    .btn,
    .spinner {
        animation: none !important;
        transition: none !important;
    }
}
