/* =====================================================
   Telas de autenticação — visual alinhado ao site (/)
   Background: ../images/hero-bg.jpg
   ===================================================== */

.tela-auth {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body:has(#tela-login:not(.hidden)),
body:has(#tela-cadastro:not(.hidden)),
body:has(#tela-recuperar-senha:not(.hidden)) {
    overflow-x: hidden;
    overflow-y: auto;
}

.tela-auth .auth-hero-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #1a1228;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.tela-auth .auth-hero-bg--neutral {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(121, 62, 165, 0.45), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 20%, rgba(61, 124, 201, 0.28), transparent 50%),
        linear-gradient(160deg, #1a1228 0%, #2a1538 45%, #1e2a44 100%);
}

/* Sem overlays escuros — mesmo visual do hero do index.html */
.tela-auth .auth-overlay,
.tela-auth .auth-overlay-side {
    display: none !important;
    pointer-events: none !important;
}

.tela-auth .auth-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
}

.tela-auth .auth-header-logo img {
    height: 48px;
    width: auto;
    display: block;
}

.tela-auth .auth-back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.tela-auth .auth-back-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.tela-auth .auth-layout {
    position: relative;
    z-index: 10;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 440px);
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2.5rem 3rem;
}

.tela-auth .auth-hero-text {
    color: #fff;
    padding-right: 1rem;
}

.tela-auth .auth-hero-text h1 {
    font-family: "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
    color: #fff;
}

.tela-auth .auth-hero-text p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.55;
    color: #9c9c9c;
    margin: 0;
    max-width: 520px;
}

.tela-auth .auth-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tela-auth .auth-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.tela-auth .auth-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    padding: 2.25rem 2rem;
    width: 100%;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.tela-auth .auth-card--elevated {
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .tela-auth .auth-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tela-auth .auth-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tela-auth .auth-card-subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tela-auth .login-form .btn-primary {
    background: #5e3080;
    border-color: #5e3080;
    font-weight: 600;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}

.tela-auth .login-form .btn-primary:hover {
    background: #4a2666;
    border-color: #4a2666;
}

.tela-auth .login-links a {
    color: #5e3080;
    font-weight: 500;
}

.tela-auth .login-aviso-ia {
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1.25rem;
}

.tela-auth .auth-footer-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.tela-auth .auth-legal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    line-height: 1.4;
}

.tela-auth .auth-legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.tela-auth .auth-legal-footer a:hover,
.tela-auth .auth-legal-footer a:focus {
    color: #5e3080;
    text-decoration: underline;
}

.tela-auth .auth-legal-footer__sep {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Cadastro: card um pouco mais largo */
#tela-cadastro.tela-auth .auth-layout {
    grid-template-columns: 1fr minmax(320px, 480px);
}

#tela-cadastro.tela-auth .auth-card {
    max-height: calc(100vh - 6rem);
}

@media (max-width: 900px) {
    .tela-auth .auth-overlay-side {
        display: none;
    }

    .tela-auth .auth-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 1.25rem 2rem;
        align-items: start;
    }

    .tela-auth .auth-hero-text {
        text-align: center;
        padding-right: 0;
    }

    .tela-auth .auth-hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .tela-auth .auth-hero-badges {
        justify-content: center;
    }

    .tela-auth .auth-header {
        padding: 1rem 1.25rem;
    }

    .tela-auth .auth-card {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .tela-auth .auth-header-logo img {
        height: 34px;
    }

    .tela-auth .auth-back-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.65rem;
    }

    .tela-auth .auth-card {
        padding: 1.5rem 1.25rem;
    }
}

/* CTA verde de conversão */
.btn-cta-trial,
.tela-auth .btn.btn-cta-trial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #1faa5a !important;
    border-color: #1faa5a !important;
    color: #fff !important;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.95rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 170, 90, 0.35);
    text-decoration: none;
}

.btn-cta-trial:hover,
.tela-auth .btn.btn-cta-trial:hover {
    background: #178a47 !important;
    border-color: #178a47 !important;
    color: #fff !important;
}

.auth-hero-cta {
    margin-top: 1.75rem;
    margin-bottom: 1.25rem;
}

.auth-benefit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.auth-benefit-list li {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.auth-benefit-list i {
    color: #1faa5a;
}

.tela-auth .login-links a.link-trial-cta {
    display: inline-block;
    color: #1faa5a;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.tela-auth .btn-login-subtle {
    background: #5e3080;
    border-color: #5e3080;
}

.label-optional {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.tela-auth .login-links--forgot {
    margin: 0.85rem 0 0.35rem;
    text-align: center;
}

.tela-auth .login-links--forgot a,
.tela-auth .btn-link-auth {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5e3080;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.tela-auth .btn-link-auth:hover,
.tela-auth .btn-link-auth:focus {
    color: #4a2666;
    outline: none;
}

.tela-auth .login-links--stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.tela-auth .auth-layout--centered {
    justify-content: center;
}

.tela-auth .auth-card--narrow {
    width: 100%;
    max-width: 420px;
}

.tela-auth .form-feedback {
    margin: -0.35rem 0 0.85rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tela-auth .form-feedback--error {
    color: #b91c1c;
}

[data-theme="dark"] .tela-auth .form-feedback--error {
    color: #fca5a5;
}

#recuperar-codigo {
    letter-spacing: 0.35em;
    font-size: 1.25rem;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 900px) {
    .auth-hero-cta {
        width: 100%;
    }

    .auth-benefit-list {
        align-items: center;
    }
}
