:root {
    --level-navy: #1c213f;
    --level-orange: #ff7a1a;
    --level-orange-strong: #f26a00;
    --text-strong: #1c213f;
    --text-muted: #5a6478;
    --border: #e2e6ee;
    --surface: #ffffff;
    --surface-alt: #f7f8fb;
    --field-bg: #f7f8fb;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text-strong);
    background-color: var(--surface-alt);
    -webkit-font-smoothing: antialiased;
}

.login-page {
    display: grid;
    grid-template-columns: 70% 30%;
    min-height: 100vh;
}

/* ============================================================
   Campo geometrico animado (losangos da marca)
   ============================================================ */

.geo-field {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.geo {
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: var(--s);
    height: var(--s);
    border-radius: calc(var(--s) * 0.22);
    opacity: 0;
    animation:
        geo-in 1s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s) both,
        geo-float var(--d, 14s) ease-in-out calc(var(--delay, 0s) + 1s) infinite alternate;
    will-change: transform;
}

/* Variantes do painel escuro */
.geo--line {
    border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.geo--accent {
    border: 1.5px solid var(--level-orange);
}

.geo--fill {
    background-color: var(--level-orange);
}

.geo--soft-fill {
    background-color: #ffffff;
}

/* Variantes do painel claro */
.geo--outline {
    border: 1.5px solid #e3e7f0;
}

.geo--peach {
    background-color: #fde3c8;
}

.geo--peach-soft {
    background-color: #fdf1e6;
}

.geo-field--light .geo {
    --amp: -14px;
    --spin: -4deg;
    --sc: 1.02;
}

.geo:nth-child(even) {
    --spin: -7deg;
}

@keyframes geo-in {
    from {
        opacity: 0;
        transform: rotate(45deg) scale(0.7);
    }

    to {
        opacity: var(--o, 1);
        transform: rotate(45deg) scale(1);
    }
}

@keyframes geo-float {
    from {
        transform: rotate(45deg) translateY(0) scale(1);
    }

    to {
        transform: rotate(calc(45deg + var(--spin, 6deg))) translateY(var(--amp, -24px)) scale(var(--sc, 1.05));
    }
}

/* Marca da Level desenhada em traco, recortada no canto */
.geo-mark {
    position: absolute;
    right: -110px;
    bottom: -120px;
    width: 460px;
    height: 460px;
}

.geo-mark__path {
    fill: none;
    stroke: var(--level-orange);
    stroke-width: 2.5;
    stroke-dasharray: 720;
    stroke-dashoffset: 720;
    opacity: 0.42;
    animation:
        geo-draw 2.4s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards,
        geo-breathe 9s ease-in-out 3s infinite alternate;
}

.geo-mark__path--b {
    stroke: rgba(255, 255, 255, 0.85);
    opacity: 0.16;
    animation-delay: 1.1s, 3.6s;
}

@keyframes geo-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes geo-breathe {
    to {
        opacity: 0.75;
    }
}

/* Chevrons da identidade */
.geo-chevron {
    position: absolute;
    left: 48px;
    bottom: 40px;
    width: 66px;
    height: 24px;
}

.geo-chevron path {
    fill: none;
    stroke: var(--level-orange);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.25;
    animation: geo-chev 3s ease-in-out infinite;
}

.geo-chevron path:nth-child(2) {
    animation-delay: 0.18s;
}

.geo-chevron path:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes geo-chev {

    0%,
    55%,
    100% {
        opacity: 0.22;
        transform: translateX(0);
    }

    28% {
        opacity: 0.85;
        transform: translateX(3px);
    }
}

/* ---------- Painel escuro (marca) ---------- */

.login-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    background: linear-gradient(135deg, #171b36 0%, var(--level-navy) 45%, #333a63 100%);
}

.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
}

.login-brand::before {
    width: 520px;
    height: 520px;
    top: -180px;
    left: -160px;
    background: radial-gradient(circle, rgba(255, 122, 26, 0.18) 0%, rgba(255, 122, 26, 0) 70%);
    animation: glow-drift 16s ease-in-out infinite alternate;
}

.login-brand::after {
    width: 620px;
    height: 620px;
    bottom: -260px;
    right: -200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    animation: glow-drift 22s ease-in-out 2s infinite alternate-reverse;
}

@keyframes glow-drift {
    to {
        transform: translate3d(40px, 30px, 0) scale(1.12);
    }
}

.login-brand__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 560px;
    animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand__logo {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.login-brand__title {
    margin: 40px 0 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* ---------- Painel do formulário ---------- */

.login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    overflow: hidden;
    background-color: var(--surface-alt);
}

.login-panel__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.login-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 34px 28px;
    box-shadow: 0 12px 32px rgba(28, 33, 63, 0.06);
    animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.4px;
}

.login-card__subtitle {
    margin: 10px 0 28px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-strong);
}

.login-input {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #8a93a8;
    transition: color 0.15s ease;
    pointer-events: none;
}

.login-input input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-strong);
    background-color: var(--field-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.login-input input::placeholder {
    color: #9aa3b5;
}

.login-input input:focus {
    outline: none;
    background-color: var(--surface);
    border-color: var(--level-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16);
}

.login-input:focus-within svg {
    color: var(--level-orange);
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    margin-top: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--level-orange);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.login-button:hover {
    background-color: var(--level-orange-strong);
    box-shadow: 0 6px 18px rgba(255, 122, 26, 0.32);
}

.login-button:active {
    transform: translateY(1px);
}

.login-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.35);
}

.login-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    box-shadow: none;
}

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

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

.login-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    font-size: 0.875rem;
    color: #9b2226;
    background-color: #fdecec;
    border: 1px solid #f6c8c8;
    border-radius: 8px;
}

.login-footer {
    margin: 24px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: #8a93a8;
    animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

/* Versão do portal: confere qual release está no ar sem abrir terminal. */
.login-versao {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: #a6aebd;
}

/* ---------- Responsivo ---------- */

/* Abaixo de 1280px o painel de 30% fica apertado demais para o card. */
@media (max-width: 1279px) {
    .login-page {
        grid-template-columns: 62% 38%;
    }

    .login-brand__logo {
        max-width: 300px;
    }

    .login-brand__title {
        font-size: 2.1rem;
    }
}

@media (max-width: 991px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 40px 24px;
        min-height: 260px;
    }

    .login-brand__logo {
        max-width: 210px;
    }

    .login-brand__title {
        margin-top: 24px;
        font-size: 1.6rem;
    }

    .geo-mark {
        width: 300px;
        height: 300px;
        right: -90px;
        bottom: -100px;
    }

    .geo-chevron {
        left: 24px;
        bottom: 20px;
    }

    .login-panel {
        padding: 32px 20px 48px;
    }
}

@media (max-width: 420px) {
    .login-card {
        padding: 28px 20px;
    }
}

/* ---------- Acessibilidade: sem movimento ---------- */

@media (prefers-reduced-motion: reduce) {

    .geo,
    .geo-mark__path,
    .geo-chevron path,
    .login-brand::before,
    .login-brand::after,
    .login-brand__content,
    .login-brand__title,
    .login-card,
    .login-footer,
    .login-spinner,
    .login-button,
    .login-input input,
    .login-input svg {
        animation: none !important;
        transition: none !important;
    }

    .geo {
        opacity: var(--o, 1);
        transform: rotate(45deg);
    }

    .geo-mark__path {
        stroke-dashoffset: 0;
    }

    .login-brand__content,
    .login-card,
    .login-footer {
        opacity: 1;
        transform: none;
    }
}
