:root {
    --ag-bg: #0f0f0f;
    --ag-surface: #202020;
    --ag-surface-alt: #2b2b2b;
    --ag-border: #333333;
    --ag-text: #f8f8f8;
    --ag-text-muted: #9a9a9a;
    --ag-primary: #5dd62c;
    --ag-primary-hover: #6ee83f;
    --ag-primary-contrast: #0f0f0f;
    --ag-danger: #f87171;
}

* {
    box-sizing: border-box;
}

body.ag-site-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ag-bg);
    color: var(--ag-text);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
}

main {
    flex: 1;
}

.ag-header {
    background: var(--ag-surface);
    border-bottom: 1px solid var(--ag-border);
}

.ag-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}

.ag-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--ag-text);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}

.ag-brand-logo {
    display: block;
    height: 30px;
    width: auto;
    flex-shrink: 0;
}

.ag-brand-logo-escuro {
    display: none;
}

.ag-brand-name {
    padding-left: 12px;
    border-left: 1px solid var(--ag-border);
    color: var(--ag-text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .02em;
    line-height: 30px;
}

.ag-auth-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 64px 24px 90px;
    display: flex;
    justify-content: center;
}

.ag-auth-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 14px;
    padding: 34px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .18);
}

.ag-auth-card.ag-auth-wide {
    max-width: 560px;
}

.ag-auth-card h1 {
    font-size: 1.4rem;
    margin: 0 0 6px;
    color: var(--ag-text);
}

.ag-auth-sub {
    color: var(--ag-text-muted);
    font-size: .9rem;
    margin: 0 0 24px;
}

.ag-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ag-field label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ag-text);
}

.ag-text-muted {
    color: var(--ag-text-muted);
}

.ag-auth-card input.ui-inputtext,
.ag-auth-card input.ui-widget,
.ag-auth-card .ui-inputtext {
    background: var(--ag-surface-alt) !important;
    border: 1px solid var(--ag-border) !important;
    color: var(--ag-text) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
}

.ag-auth-card input.ui-inputtext:focus,
.ag-auth-card .ui-inputtext:focus {
    border-color: var(--ag-primary) !important;
    box-shadow: 0 0 0 1px var(--ag-primary) !important;
    outline: none !important;
}

.ag-auth-card .ui-button,
.ag-auth-card .ui-button.ui-widget {
    background: var(--ag-primary) !important;
    border: 1px solid var(--ag-primary) !important;
    color: var(--ag-primary-contrast) !important;
    border-radius: 9px !important;
    font-weight: 600 !important;
    padding: 11px 16px !important;
    transition: background .15s ease;
}

.ag-auth-card .ui-button:hover {
    background: var(--ag-primary-hover) !important;
    border-color: var(--ag-primary-hover) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--ag-surface-alt) inset !important;
    -webkit-text-fill-color: var(--ag-text) !important;
    caret-color: var(--ag-text) !important;
    transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}

.ag-auth-footer {
    margin-top: 18px;
    font-size: .88rem;
    color: var(--ag-text-muted);
    text-align: center;
}

.ag-auth-footer a {
    color: var(--ag-primary);
}

.ag-footer {
    background: var(--ag-surface);
    border-top: 1px solid var(--ag-border);
    color: var(--ag-text-muted);
    padding: 22px 24px;
    font-size: .82rem;
}

.ag-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    text-align: center;
}

.ag-auth-card .ui-messages-info,
.ag-auth-card .ui-message-info {
    background: var(--ag-surface-alt) !important;
    border: 1px solid var(--ag-border) !important;
    border-left: 4px solid var(--ag-primary) !important;
    border-radius: 10px !important;
    color: var(--ag-text) !important;
    padding: 12px 14px !important;
    margin-bottom: 16px !important;
    display: block;
}

.ag-auth-card .ui-messages-error,
.ag-auth-card .ui-message-error {
    background: var(--ag-surface-alt) !important;
    border: 1px solid var(--ag-border) !important;
    border-left: 4px solid var(--ag-danger) !important;
    border-radius: 10px !important;
    color: var(--ag-text) !important;
    padding: 12px 14px !important;
    margin-bottom: 16px !important;
    display: block;
}

.ag-split-screen {
    display: flex;
    min-height: 100vh;
}

.ag-split-brand {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    background:
            radial-gradient(circle at 20% 20%, #a3f08a 0%, transparent 50%),
            radial-gradient(circle at 85% 25%, #2a5f13 0%, transparent 55%),
            radial-gradient(circle at 30% 85%, #5dd62c 0%, transparent 55%),
            radial-gradient(circle at 75% 80%, #133008 0%, transparent 60%),
            #1f4a0f;
    background-size: 180% 180%, 180% 180%, 180% 180%, 180% 180%, auto;
    animation: ag-gradient-drift 22s ease-in-out infinite;
    display: flex;
    align-items: center;
    padding: 60px;
    color: #fff;
}

@keyframes ag-gradient-drift {
    0% {
        background-position: 20% 20%, 85% 25%, 30% 85%, 75% 80%, 0 0;
    }
    33% {
        background-position: 55% 35%, 40% 70%, 70% 15%, 20% 55%, 0 0;
    }
    66% {
        background-position: 35% 65%, 70% 10%, 15% 45%, 60% 30%, 0 0;
    }
    100% {
        background-position: 20% 20%, 85% 25%, 30% 85%, 75% 80%, 0 0;
    }
}

.ag-split-brand-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .35;
    pointer-events: none;
    animation: ag-blob-float 10s ease-in-out infinite;
}

.ag-blob-1 {
    width: 300px;
    height: 300px;
    top: -90px;
    right: -70px;
    background: #ffffff;
}

.ag-blob-2 {
    width: 340px;
    height: 340px;
    bottom: -110px;
    left: -90px;
    background: #0a1f05;
    opacity: .5;
    animation-duration: 13s;
    animation-delay: -4s;
}

@keyframes ag-blob-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(24px, -18px) scale(1.08);
    }
}

.ag-split-brand-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
    animation: ag-fade-in-up .6s ease both;
}

.ag-cursor-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 220px at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, .09), transparent 100%);
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}

.ag-split-form .ag-auth-card {
    animation: ag-fade-in-up .6s ease .1s both;
}

@keyframes ag-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ag-split-brand-content .ag-brand {
    color: #fff !important;
    margin-bottom: 48px;
}

.ag-split-brand-content .ag-brand-logo {
    height: 40px;
}

.ag-split-brand-content .ag-brand-name {
    color: #fff;
    border-left-color: rgba(255, 255, 255, .45);
    line-height: 40px;
    font-size: 1.15rem;
}

.ag-split-brand-content h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    margin: 0 0 16px;
    font-weight: 700;
}

.ag-split-brand-content p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: .92;
    margin: 0 0 34px;
}

.ag-split-brand-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ag-split-brand-features div {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: .92rem;
}

.ag-split-brand-features .pi {
    font-size: 1rem;
    opacity: .95;
}

.ag-split-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--ag-bg);
}

.ag-split-form .ag-auth-card {
    animation: ag-fade-in-up .6s ease .1s both;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
    padding: 40px 38px;
}

.ag-auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--ag-primary) 16%, transparent);
    color: var(--ag-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .ag-split-brand {
        display: none;
    }
}