* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: var(--text-on-dark, #ffffff);
    background: linear-gradient(
        120deg,
        var(--bg-login-1, #1b1f3b),
        var(--bg-login-2, #22243a),
        var(--bg-login-3, #101535),
        var(--bg-login-4, #02083f)
    );
    background-size: 400% 400%;
    animation: bgAnimado 14s ease infinite;
    overflow-x: hidden;
    position: relative;
}

body.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(230, 180, 90, 0.15), transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(2, 8, 63, 0.25), transparent 40%);
    animation: ondasBg 18s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes bgAnimado {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ondasBg {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -30px); }
    100% { transform: translate(0, 0); }
}

.cad-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.cad-orb {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    opacity: 0.45;
    filter: blur(4px);
    animation: cadOrb 12s ease-in-out infinite;
    mix-blend-mode: multiply;
}

.cad-orb.orb-1 {
    top: -120px;
    left: -80px;
    background: radial-gradient(circle at 30% 30%, rgba(2, 8, 63, 0.35), rgba(2, 8, 63, 0.1) 60%, transparent 70%);
}

.cad-orb.orb-2 {
    top: 20%;
    right: -140px;
    background: radial-gradient(circle at 70% 30%, rgba(34, 36, 58, 0.35), rgba(34, 36, 58, 0.1) 60%, transparent 70%);
    animation-delay: -6s;
}

.cad-orb.orb-3 {
    bottom: -160px;
    left: 15%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at 40% 60%, rgba(230, 180, 90, 0.35), rgba(230, 180, 90, 0.12) 60%, transparent 70%);
    animation-delay: -10s;
}

.cad-orb.orb-4 {
    bottom: -180px;
    right: 10%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle at 40% 40%, rgba(2, 8, 63, 0.25), rgba(2, 8, 63, 0.08) 60%, transparent 70%);
    animation-delay: -14s;
}

.cad-grid {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 90px 90px;
    opacity: 0.2;
    transform: perspective(900px) rotateX(55deg);
    animation: cadGrid 18s linear infinite;
}

.cad-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 60%, transparent 70%);
    box-shadow: 0 0 12px rgba(2, 8, 63, 0.25), 0 0 26px rgba(230, 180, 90, 0.25);
    opacity: 0.85;
    animation: cadParticle 7s ease-in-out infinite;
}

.cad-particle.p1 { top: 18%; left: 20%; animation-delay: -1s; }
.cad-particle.p2 { top: 30%; left: 70%; animation-delay: -3s; }
.cad-particle.p3 { top: 62%; left: 12%; animation-delay: -5s; }
.cad-particle.p4 { top: 72%; left: 82%; animation-delay: -7s; }
.cad-particle.p5 { top: 42%; left: 48%; animation-delay: -9s; }
.cad-particle.p6 { top: 82%; left: 30%; animation-delay: -11s; }

@keyframes cadOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes cadGrid {
    0% { transform: perspective(900px) rotateX(55deg) translateY(0); }
    50% { transform: perspective(900px) rotateX(55deg) translateY(30px); }
    100% { transform: perspective(900px) rotateX(55deg) translateY(0); }
}

@keyframes cadParticle {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, -24px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
    align-items: center;
    gap: 36px;
    padding: 28px;
    position: relative;
    z-index: 1;
    max-width: 1360px;
    margin: 0 auto;
}

.login-brand-panel {
    align-self: stretch;
    border-radius: 20px;
    padding: 40px;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.46));
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.32);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    width: 340px;
    height: 148px;
    left: 50%;
    top: 48px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 50%, rgba(147, 197, 253, 0.28), rgba(147, 197, 253, 0.04) 58%, transparent 74%),
        conic-gradient(from 0deg, rgba(147, 197, 253, 0.45), rgba(56, 189, 248, 0.12), rgba(147, 197, 253, 0.45));
    filter: blur(10px);
    opacity: 0.82;
    animation: logoAuraSpin 8s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 120%;
    left: -260px;
    top: -10%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(147, 197, 253, 0.18), rgba(255, 255, 255, 0));
    animation: logoSweep 4.6s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

.login-brand-panel > * {
    position: relative;
    z-index: 2;
}

body.login-page .login-brand-panel,
body.login-page .login-brand-panel * {
    color: #e2e8f0 !important;
}

.login-brand-logo {
    width: min(620px, 88%);
    max-height: 260px;
    height: auto;
    margin: 0 auto 8px;
    display: block;
    object-fit: contain;
    transform: none;
    transform-origin: center;
    opacity: 1;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.42));
    animation: none;
}

@keyframes logoShowcaseAuth {
    0%,
    100% {
        transform: translateY(0) scale(1.16) rotate(-0.8deg);
    }
    25% {
        transform: translateY(-4px) scale(1.185) rotate(0.8deg);
    }
    50% {
        transform: translateY(-8px) scale(1.205) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) scale(1.175) rotate(-0.6deg);
    }
}

@keyframes logoPulseAuth {
    0%,
    100% {
        filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 22px rgba(147, 197, 253, 0.28));
    }
    50% {
        filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.52)) drop-shadow(0 0 42px rgba(147, 197, 253, 0.62));
    }
}

@keyframes logoAuraSpin {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg);
    }
}

@keyframes logoSweep {
    0%,
    100% {
        left: -260px;
        opacity: 0;
    }
    35% {
        opacity: 0.9;
    }
    60% {
        left: calc(100% + 40px);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-brand-panel::before,
    .login-brand-panel::after,
    .login-brand-logo {
        animation: none !important;
    }
}

.login-brand-panel h2 {
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: 800;
    color: #f8fafc !important;
}

.login-brand-panel p {
    color: rgba(226, 232, 240, 0.95);
    font-size: 15px;
    line-height: 1.55;
    max-width: 56ch;
}

.login-brand-panel ul {
    list-style: none;
    display: grid;
    gap: 10px;
    color: rgba(226, 232, 240, 0.98);
    font-size: 14px;
    font-weight: 500;
}

.login-brand-panel li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-brand-panel li i {
    color: #93c5fd !important;
}

.login-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(520px, 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.96));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.login-header {
    padding: 34px 34px 20px;
    text-align: center;
}

.login-header img {
    width: clamp(170px, 19vw, 220px);
    height: auto;
    margin: 0 auto 14px;
    display: block;
    filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.22)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.15));
    animation: none;
}

.login-header h1 {
    color: #0f172a;
    font-size: clamp(24px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 15px;
    color: var(--text-secondary, #525a68);
}

.auth-form,
#loginForm {
    padding: 12px 34px 30px;
    display: grid;
    gap: 14px;
}

.field-block {
    display: grid;
    gap: 8px;
}

.field-block > label {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.login-row {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 8px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.login-row:hover {
    border-color: #64748b;
}

.login-row:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-row i {
    color: #64748b;
    font-size: 16px;
}

.login-row input {
    border: 0;
    background: transparent;
    outline: none;
    color: #0f172a;
    font-size: 14px;
    width: 100%;
}

.login-row input::placeholder {
    color: #94a3b8;
}

.login-row--password {
    grid-template-columns: 38px 1fr 34px;
}

.toggle-password {
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    background: rgba(100, 116, 139, 0.12);
    color: #1e293b;
}

.login-inline-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: -2px;
}

.login-support-note {
    margin-top: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.remember-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    user-select: none;
}

.remember-check input {
    accent-color: #2563eb;
    width: 16px;
    height: 16px;
}

.forgot-link {
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

#login-submit {
    margin-top: 6px;
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    border: 0;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#login-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

#login-submit:active {
    transform: translateY(0);
}

#login-submit:disabled {
    opacity: 0.9;
    cursor: wait;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: none;
}

#login-submit.is-loading .btn-spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-future button {
    margin-top: 2px;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px dashed #94a3b8;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.login-link {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 34px 28px;
    font-size: 14px;
    color: #94a3b8;
}

.login-link a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

.login-link span {
    color: #94a3b8;
}

#login-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(2, 8, 20, 0.82);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

#login-transition.ativo {
    opacity: 1;
    visibility: visible;
}

.login-transition__content {
    width: min(140px, 45vw);
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.35);
    animation: pulseRing 1.8s ease-in-out infinite;
}

.login-transition__content img {
    width: 70%;
    animation: spin 1.2s linear infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.98); opacity: 0.75; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.98); opacity: 0.75; }
}

@media (max-width: 1040px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }

    .login-brand-panel {
        display: none;
    }

    .login-wrapper {
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .login-shell {
        padding: 14px;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-header {
        padding: 24px 20px 16px;
    }

    .auth-form,
    #loginForm {
        padding: 10px 20px 22px;
    }

    .login-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-link {
        padding: 0 20px 20px;
        font-size: 13px;
    }
}

/* Evita zoom automatico no iOS ao focar campos de formulario */
@media (max-width: 768px) {
    .login-row input {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
