:root {
    --azul-900: #042845;
    --azul-800: #054075;
    --azul-700: #0b5ea4;
    --azul-200: #d8e8fa;
    --azul-100: #eaf3ff;
    --fundo: #eef3fa;
    --branco: #ffffff;
    --texto: #172b42;
    --texto-sec: #566c84;
    --borda: #d6e2ef;
    --sucesso: #1f8f5f;
    --alerta: #a16a00;
    --sombra: 0 14px 32px rgba(6, 36, 68, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Barlow', sans-serif;
    color: var(--texto);
}

body.page-transition {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
    filter: blur(1px);
    transition:
        opacity 0.24s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.24s ease;
    will-change: opacity, transform, filter;
}

body.page-transition.is-ready {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

body.page-transition.is-leaving {
    opacity: 0;
    transform: translateY(-6px) scale(0.996);
    filter: blur(0.8px);
    pointer-events: none;
}

.login-body {
    background:
        radial-gradient(circle at 15% 10%, rgba(11, 94, 164, 0.14) 0%, transparent 28%),
        radial-gradient(circle at 85% 22%, rgba(5, 64, 117, 0.12) 0%, transparent 32%),
        linear-gradient(180deg, #f5f9ff 0%, var(--fundo) 100%);
    position: relative;
    overflow-x: hidden;
}

.login-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        url('/static/images/backgrounds/fundo-jabirosca.png') center bottom / cover no-repeat,
        radial-gradient(circle at 12% 24%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px) 0 0 / 120px 120px,
        radial-gradient(circle at 88% 42%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px) 0 0 / 160px 160px;
    opacity: 0.38;
    z-index: 0;
}

.topbar,
.login-wrapper {
    position: relative;
    z-index: 1;
}

.topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #d8e4f0;
    backdrop-filter: blur(4px);
}

.topbar-content {
    width: min(1120px, calc(100% - 2rem));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-logo {
    width: 144px;
}

.topbar-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.topbar-text strong {
    font-size: 1rem;
}

.topbar-text span {
    font-size: 0.94rem;
    color: var(--texto-sec);
}

.login-wrapper {
    width: min(1120px, calc(100% - 2rem));
    margin: 2rem auto 2.5rem;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.brand-card,
.form-card,
.mini-card {
    border-radius: 20px;
    border: 1px solid var(--borda);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(3px);
    box-shadow: var(--sombra);
}

.brand-card {
    padding: 2.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #c2d8f0;
    background: #e8f2ff;
    color: var(--azul-800);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-card h1 {
    margin: 1rem 0 0.95rem;
    font-size: clamp(2.15rem, 3.4vw, 3.25rem);
    line-height: 1.04;
    max-width: 14ch;
}

.brand-card p,
.intro {
    margin: 0;
    color: var(--texto-sec);
    font-size: 1.02rem;
    line-height: 1.56;
}

.feature-list {
    margin: 1.6rem 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--borda);
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.92rem 0;
    border-bottom: 1px solid var(--borda);
    font-size: 0.97rem;
}

.feature-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #bdd4ec;
    background: linear-gradient(150deg, #e9f3ff, #cfe3fa);
}

.feature-icon i {
    font-size: 0.84rem;
    color: var(--azul-700);
}

.form-panel {
    height: 100%;
}

.form-card {
    height: 100%;
    padding: 2rem 1.7rem;
    display: flex;
    flex-direction: column;
}

.form-card h2 {
    margin: 1rem 0 0.55rem;
    font-size: clamp(2rem, 2.2vw, 2.55rem);
    line-height: 1.07;
}

.login-form {
    margin-top: 1.25rem;
}

.field-group {
    margin-bottom: 0.95rem;
}

.field-group label {
    display: block;
    margin-bottom: 0.42rem;
    font-size: 0.96rem;
    font-weight: 700;
    color: #18314a;
}

.field-group input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: var(--branco);
    color: var(--texto);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group input:focus {
    outline: none;
    border-color: var(--azul-800);
    box-shadow: 0 0 0 3px rgba(5, 64, 117, 0.12);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #edf4fc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.eye-icon {
    font-size: 0.95rem;
    color: var(--azul-800);
}

.readonly-field {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--borda);
    background: var(--azul-100);
}

.readonly-field span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.86rem;
    color: var(--texto-sec);
}

.readonly-field strong {
    font-size: 1.08rem;
}

.primary-button {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(130deg, #07548f, #054075);
    color: #fff;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(5, 64, 117, 0.24);
}

.helper-text {
    margin: 0.78rem 0 0;
    color: var(--texto-sec);
    font-size: 0.9rem;
}

.messages {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.message {
    padding: 0.82rem 0.95rem;
    border-radius: 12px;
    font-size: 0.93rem;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 0.62rem;
    line-height: 1.35;
}

.message-icon {
    width: 1.1rem;
    min-width: 1.1rem;
    margin-top: 0.08rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
}

.message.success {
    background: #edf8f2;
    border: 1px solid #cdebd9;
    color: var(--sucesso);
}

.message.warning {
    background: #fff6e6;
    border: 1px solid #f1dfb2;
    color: var(--alerta);
}

.message.error {
    background: linear-gradient(180deg, #fff5f4 0%, #ffefee 100%);
    border: 1px solid #f7c6c3;
    border-left: 4px solid #d92d20;
    color: #7f1d1d;
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.08);
}

.message.error .message-icon {
    color: #d92d20;
}

.field-error {
    display: block;
    margin-top: 0.34rem;
    color: #b42318;
    font-size: 0.86rem;
}

.mini-cards {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.mini-card {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.72rem;
}

.mini-card h3 {
    margin: 0 0 0.32rem;
    font-size: 1.05rem;
}

.mini-card p {
    margin: 0;
    color: var(--texto-sec);
    font-size: 0.93rem;
    line-height: 1.42;
}

.mini-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient(155deg, #2d83cb, #1b69aa);
}

.mini-icon i {
    font-size: 1rem;
    color: #fff;
}

.dashboard-body {
    min-height: 100vh;
    background: var(--fundo);
}

.dashboard-shell {
    width: min(920px, calc(100% - 2rem));
    margin: 2rem auto;
}

.dashboard-card {
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--borda);
    background: #fff;
    box-shadow: var(--sombra);
}

.dashboard-card h1 {
    margin: 0.9rem 0 0.7rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1.4rem 0;
}

.summary-grid article {
    border: 1px solid var(--borda);
    border-radius: 12px;
    background: #f8fbff;
    padding: 1rem;
}

.summary-grid span {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--texto-sec);
    font-size: 0.92rem;
}

.summary-grid strong {
    font-size: 1.05rem;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.splash-body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    font-family: 'Barlow', sans-serif;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 34%, rgba(232, 241, 253, 0.92) 60%, rgba(216, 230, 248, 0.9) 100%);
}

.splash-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 74%, rgba(166, 195, 236, 0.34), transparent 34%),
        radial-gradient(circle at 80% 78%, rgba(145, 183, 231, 0.35), transparent 36%),
        radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.68), transparent 40%),
        url('/static/images/backgrounds/fundo-jabirosca.png') center bottom / cover no-repeat;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

.splash-body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 8% 58%, rgba(255, 255, 255, 0.72) 0 2px, transparent 4px) 0 0 / 210px 210px,
        radial-gradient(circle at 84% 36%, rgba(255, 255, 255, 0.56) 0 2px, transparent 4px) 0 0 / 240px 240px,
        radial-gradient(circle at 72% 84%, rgba(255, 255, 255, 0.5) 0 1px, transparent 3px) 0 0 / 140px 140px;
}

.splash-stage {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.splash-hero {
    text-align: center;
    position: relative;
    z-index: 2;
    transform: translateY(-4vh);
}

.splash-main-logo {
    width: min(400px, 62vw);
    filter: drop-shadow(0 14px 28px rgba(15, 49, 88, 0.18));
}

.splash-status {
    margin: 1.15rem 0 1.4rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #6685af;
}

.splash-dots-loader {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto;
}

.splash-dots-loader span {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8eb1dc;
    left: 50%;
    top: 50%;
    transform: rotate(calc(var(--i) * 30deg)) translate(0, -40px);
    transform-origin: center;
    animation: splash-dot 1.1s linear infinite;
    animation-delay: calc(var(--i) * 0.09s);
}

.splash-decor {
    position: absolute;
    top: 22%;
    z-index: 1;
    opacity: 0.38;
}

.splash-decor-left {
    left: clamp(1rem, 6vw, 7rem);
}

.splash-decor-right {
    right: clamp(1rem, 6vw, 7rem);
}

.decor-item {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6e9fd6;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(145, 181, 227, 0.46);
    box-shadow: 0 10px 26px rgba(63, 108, 164, 0.16);
}

.decor-item i {
    font-size: 1.8rem;
}

.decor-item.card {
    width: 180px;
    height: 110px;
    transform: rotate(-12deg);
    top: 66px;
    left: 0;
}

.decor-item.bag {
    width: 80px;
    height: 80px;
    top: -4px;
    left: -34px;
}

.decor-item.mail {
    width: 76px;
    height: 66px;
    top: 16px;
    left: 140px;
}

.decor-item.shield {
    width: 120px;
    height: 120px;
    top: 0;
    right: 0;
}

.decor-item.shield i {
    font-size: 2.65rem;
}

.decor-item.chart {
    width: 140px;
    height: 90px;
    top: 118px;
    right: -28px;
}

.splash-wave-layer {
    position: absolute;
    left: -8%;
    width: 116%;
    border-radius: 50% 50% 0 0 / 22% 22% 0 0;
    pointer-events: none;
}

.wave-a {
    bottom: -9%;
    height: 36%;
    background: linear-gradient(180deg, rgba(196, 216, 243, 0.4), rgba(153, 187, 233, 0.52));
}

.wave-b {
    bottom: -14%;
    height: 32%;
    background: linear-gradient(180deg, rgba(160, 192, 235, 0.44), rgba(119, 163, 223, 0.56));
}

.wave-c {
    bottom: -21%;
    height: 28%;
    background: linear-gradient(180deg, rgba(109, 150, 214, 0.56), rgba(76, 123, 196, 0.74));
}

@keyframes splash-dot {
    0%,
    100% {
        opacity: 0.2;
        transform: rotate(calc(var(--i) * 30deg)) translate(0, -40px) scale(0.8);
    }
    40% {
        opacity: 1;
        background: #2f6cb3;
        transform: rotate(calc(var(--i) * 30deg)) translate(0, -40px) scale(1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-transition,
    body.page-transition.is-ready,
    body.page-transition.is-leaving {
        transition: none;
        transform: none;
        filter: none;
        opacity: 1;
    }

    .splash-dots-loader span {
        animation: none;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .mini-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar-content,
    .login-wrapper,
    .dashboard-shell {
        width: min(100%, calc(100% - 1rem));
    }

    .brand-card,
    .form-card,
    .mini-card,
    .dashboard-card {
        padding: 1.2rem;
    }

    .brand-card h1 {
        font-size: clamp(2rem, 10vw, 2.55rem);
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .splash-main-logo {
        width: min(320px, 72vw);
    }

    .splash-status {
        font-size: clamp(1.6rem, 8vw, 2.3rem);
    }

    .splash-dots-loader {
        transform: scale(0.88);
    }

    .splash-decor {
        opacity: 0.24;
    }

    .decor-item.chart,
    .decor-item.mail {
        display: none;
    }
}
