:root {
    --auth-page: #f3efe9;
    --auth-card: #ffffff;
    --auth-border: #e5e1d8;
    --auth-input-border: #ddd8cd;
    --auth-accent: #8b0000;
    --auth-accent-hover: #a50000;
    --auth-text: #1d1d1f;
    --auth-muted: #6b6b70;
    --auth-soft: #8a8a8f;
}

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

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--auth-page);
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ---------- HERO (lado esquerdo) ---------- */
.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 4vw, 3.25rem);
    color: #fff;
    background-color: #2a1410;
    background-image:
        url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=1400&q=80');
    background-size: cover;
    background-position: center;
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(139, 0, 0, 0.45), transparent 55%),
        linear-gradient(160deg, rgba(20, 10, 8, 0.35) 0%, rgba(20, 10, 8, 0.55) 55%, rgba(20, 10, 8, 0.85) 100%);
}

.auth-hero__top,
.auth-hero__content {
    position: relative;
    z-index: 1;
}

.auth-hero__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}

.auth-hero__logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
}

.auth-hero__content {
    max-width: 30rem;
}

.auth-hero__badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-hero__title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.85rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.auth-hero__subtitle {
    margin: 0 0 2rem;
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.auth-hero__features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
}

.auth-hero__features li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
}

.auth-hero__feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* ---------- PAINEL (lado direito) ---------- */
.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        radial-gradient(circle at 80% 0%, #fbf8f3 0%, var(--auth-page) 60%);
}

.auth-main__top {
    position: absolute;
    top: clamp(1.25rem, 3vw, 2rem);
    right: clamp(1.25rem, 3vw, 2.5rem);
}

.auth-ghost-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--auth-text);
    text-decoration: none;
    border: 1px solid var(--auth-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.auth-ghost-btn:hover {
    border-color: var(--auth-accent);
    color: var(--auth-accent);
    background: #fff;
}

.auth-card {
    width: min(100%, 27rem);
    padding: clamp(1.75rem, 3vw, 2.5rem);
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px -25px rgba(40, 20, 15, 0.25);
}

.auth-card__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--auth-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-card__back:hover {
    color: var(--auth-accent);
}

.auth-card__brand {
    margin-bottom: 1.1rem;
}

.auth-card__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.95rem;
    color: #fff;
    background: linear-gradient(145deg, var(--auth-accent), #5e0000);
    box-shadow: 0 10px 22px -8px rgba(139, 0, 0, 0.6);
}

.auth-card__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-card__subtitle {
    margin: 0.4rem 0 1.6rem;
    font-size: 0.95rem;
    color: var(--auth-muted);
}

.auth-alert {
    border-radius: 0.8rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ---------- PAINÉIS ---------- */
.auth-panel {
    display: none;
}

.auth-panel[hidden] {
    display: none !important;
}

.auth-panel.is-active {
    display: block;
    animation: authFadeIn 0.28s ease;
}

.auth-panel.is-active[hidden] {
    display: none !important;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- FORM ---------- */
.auth-form {
    display: block;
}

.auth-group {
    margin-bottom: 1.05rem;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.auth-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3a3a3d;
}

.auth-field {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.8rem 0.95rem;
    font-size: 0.95rem;
    color: var(--auth-text);
    background: #fbfaf8;
    border: 1px solid var(--auth-input-border);
    border-radius: 0.8rem;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select.auth-input {
    cursor: pointer;
}

.auth-field:has(.auth-eye) .auth-input {
    padding-right: 2.9rem;
}

.auth-input::placeholder {
    color: #a8a49b;
}

.auth-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.12);
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--auth-soft);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-eye:hover {
    color: var(--auth-accent);
    background: rgba(139, 0, 0, 0.06);
}

.auth-row-end {
    display: flex;
    justify-content: flex-end;
    margin: -0.35rem 0 1.25rem;
}

.auth-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    background: var(--auth-accent);
    border: 0;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-btn:hover,
.auth-btn:focus {
    background: var(--auth-accent-hover);
    box-shadow: 0 12px 24px -10px rgba(139, 0, 0, 0.55);
}

.auth-btn:active {
    transform: scale(0.99);
}

.auth-link-btn {
    border: 0;
    background: none;
    padding: 0;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--auth-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link-btn:hover {
    color: var(--auth-accent);
}

.auth-link-btn--strong {
    font-weight: 600;
    color: var(--auth-accent);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.auth-link-btn--strong:hover {
    color: var(--auth-accent-hover);
}

.auth-foot {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-foot a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-foot a:hover {
    text-decoration: underline;
}

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

    .auth-hero {
        display: none;
    }

    .auth-main {
        min-height: 100vh;
    }

    .auth-main__top {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 575px) {
    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 1.2rem;
    }

    .auth-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-main {
        padding-top: 4.5rem;
        justify-content: flex-start;
    }
}
