/* Reset: evita sobra branca e scroll indesejado (estilos padrão Yii2/Bootstrap) */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.auth-body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.auth-page {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Reset Bootstrap no módulo de usuário (auth) */
.auth-body .container,
.auth-page .container {
    margin: 0 !important;
    padding: 0 !important;
}

/* ——— Left: Hero (Lovable: ~60%, conteúdo no canto inferior esquerdo) ——— */
.auth-hero {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.auth-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    pointer-events: none;
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    height: 90%;
    padding: 3rem 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
}

.auth-hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 0.75rem 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.auth-hero-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    color: rgba(255, 255, 255, 0.95);
}

.auth-hero-stats {
    display: flex;
    gap: 2.5rem;
    padding-top: 0;
}

.auth-hero-stats > div {
    display: flex;
    flex-direction: column;
}

.auth-hero-stats strong {
    font-size: 1.875rem;
    font-weight: 700;
    color: #FF8C00;
}

.auth-hero-stats span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

/* ——— Right: Form side (Lovable: ~40%, fundo branco, form centralizado) ——— */
.auth-form-side {
    width: 50%;
    height: 100%;
    min-height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #003366;
    margin: 0 0 0.25rem 0;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0 0 1.75rem 0;
    text-align: center;
}

/* Form */
.auth-form {
    margin: 0;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

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

.auth-input-wrap .auth-icon,
.auth-input-wrap .auth-eye-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.auth-input-wrap .auth-eye-icon {
    left: auto;
    right: 14px;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.auth-input-wrap input,
.auth-form .form-control {
    width: 100%;
    height: 50px;
    padding: 14px 44px 14px 44px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
}

.auth-input-wrap input:focus,
.auth-form .form-control:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: none;
}

.auth-form .auth-input-wrap .form-control {
    padding-right: 44px;
}

.auth-extras {
    text-align: right;
    margin-bottom: 1rem;
}

.auth-link-btn,
.auth-link {
    font-size: 0.875rem;
    color: #2563eb;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}

.auth-link-btn:hover,
.auth-link:hover {
    text-decoration: underline;
}

.auth-submit,
.auth-btn {
    width: 100%;
    height: 52px;
    padding: 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #FF8C00;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit:hover:not(:disabled),
.auth-btn:hover:not(:disabled) {
    background: #e67e00;
}

.auth-submit:disabled,
.auth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.auth-btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

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

.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: #64748b;
}

.auth-toggle a,
.auth-toggle button {
    color: #FF8C00;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
}

.auth-toggle a:hover,
.auth-toggle button:hover {
    text-decoration: underline;
}

.auth-social-proof {
    margin-top: 2rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-align: center;
}

.auth-social-proof strong {
    color: #64748b;
}

.auth-field-hint {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 6px 0 0 0;
}

.auth-form .help-block {
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 4px;
}

/* Checkbox lembrar-me */
.auth-form .checkbox-field {
    margin-bottom: 1rem;
}

.auth-form .checkbox-field label {
    font-weight: 400;
    cursor: pointer;
}

/* Mobile e resoluções menores (layout empilhado, scroll habilitado) */
@media (max-width: 900px) {
    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .auth-page {
        display: flex; /* Garante que o flex está ativo */
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        align-items: center; /* CENTRALIZA os filhos horizontalmente na coluna */
    }
    .auth-hero {
        width: 100%;
        min-height: 220px;
        height: auto;
        flex-shrink: 0;
    }
    .auth-hero-content {
        padding: 2rem 1.5rem 2rem;
        justify-content: flex-end;
    }
    .auth-hero-content h1 {
        font-size: 2rem;
    }
    .auth-hero-content p {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }
    .auth-hero-stats {
        gap: 1.5rem;
    }
    .auth-hero-stats strong {
        font-size: 1.5rem;
    }
    .auth-hero-bg {
        background-attachment: scroll;
    }
    .auth-form-side {
        width: 100%;
        display: flex;
        justify-content: center; /* Centraliza o conteúdo interno do lado do form */
        align-items: center;
        padding: 0rem 1.5rem; /* Dá um respiro melhor em mobile */
    }

    .auth-form-container {
        width: 100%;
        max-width: 400px; /* Impede que o form fique "gigante" em tablets, mantendo-o centralizado */
        margin: 0 auto; /* Reforço da centralização */
    }
}

@media (max-width: 480px) {
    .auth-hero-content {
        padding: 1.5rem 1rem 1.5rem;
    }
    .auth-hero-content h1 {
        font-size: 1.5rem;
    }
    .auth-form-side {
        padding: 1.5rem 1rem 2rem;
    }
}
