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

.auth-body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ——— Left: Hero ——— */
.auth-hero {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.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.88) 100%);
    pointer-events: none;
}

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

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

.auth-hero-content p {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 1.75rem 0;
    color: rgba(255, 255, 255, 0.95);
    max-width: 480px;
}

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

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

.auth-hero-stats strong {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FF8C00;
    line-height: 1.1;
}

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

/* ——— Right: Form side ——— */
.auth-form-side {
    width: 50%;
    height: 100%;
    max-height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 2rem;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar discreta no desktop */
.auth-form-side::-webkit-scrollbar {
    width: 5px;
}
.auth-form-side::-webkit-scrollbar-track {
    background: transparent;
}
.auth-form-side::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
.auth-form-side::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.auth-form-container {
    width: 100%;
    max-width: 390px;
    padding: 0.5rem 0;
    margin: auto 0;
    box-sizing: border-box;
}

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

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

.auth-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #003366;
    margin: 0 0 0.15rem 0;
    text-align: center;
    letter-spacing: -0.01em;
}

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

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

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

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

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

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

.auth-input-wrap .auth-eye-icon {
    left: auto;
    right: 6px;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.auth-input-wrap .auth-eye-icon:hover {
    color: #334155;
    background: #f1f5f9;
}

.auth-input-wrap input,
.auth-form .form-control {
    width: 100%;
    height: 44px;
    padding: 8px 38px 8px 38px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    color: #1e293b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input-wrap input:focus,
.auth-form .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

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

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

.auth-link-btn:hover,
.auth-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

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

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

.auth-submit:active:not(:disabled),
.auth-btn:active:not(:disabled) {
    transform: scale(0.99);
}

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

.auth-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    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: 0.85rem;
    font-size: 0.875rem;
    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: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
}

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

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

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

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

.auth-form .checkbox-field label {
    font-weight: 400;
    font-size: 0.8125rem;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   BREAKPOINTS RESPONSIVOS
   ========================================== */

/* Tablets / Laptops pequenos (1024px a 861px) */
@media (max-width: 1024px) {
    .auth-hero {
        width: 45%;
    }
    .auth-form-side {
        width: 55%;
        padding: 1.5rem 1.25rem;
    }
    .auth-hero-content {
        padding: 2rem;
    }
    .auth-hero-content h1 {
        font-size: 2.1rem;
    }
    .auth-hero-stats {
        gap: 1.25rem;
    }
}

/* Mobile & Tablets em Modo Retrato (<= 860px) */
@media (max-width: 860px) {
    html,
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100% !important;
        background-color: #fff !important; /* Evita faixa escura no rodapé do mobile */
        -webkit-overflow-scrolling: touch;
    }
    .auth-body {
        background-color: #fff !important;
    }
    .auth-page {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
        overflow: visible !important;
        align-items: stretch;
        background: #fff;
    }
    .auth-hero {
        width: 100%;
        min-height: 150px;
        max-height: 200px;
        height: auto;
        flex-shrink: 0;
    }
    .auth-hero-content {
        height: 100%;
        padding: 1.25rem 1rem 1rem;
        justify-content: center;
    }
    .auth-hero-content h1 {
        font-size: 1.45rem;
        margin-bottom: 0.35rem;
    }
    .auth-hero-content p {
        display: none;
    }
    .auth-hero-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    .auth-hero-stats strong {
        font-size: 1.3rem;
    }
    .auth-hero-bg {
        background-attachment: scroll;
    }
    .auth-form-side {
        width: 100%;
        flex: 1 0 auto; /* Ocupa 100% do espaço restante até o final da tela */
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        overflow-y: visible !important; /* Elimina barra de rolagem interna no mobile */
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 1.5rem 1.25rem 2.5rem;
        background: #fff;
        box-sizing: border-box;
    }
    .auth-form-container {
        width: 100%;
        max-width: 390px;
        padding: 0;
        margin: 0 auto;
    }
}

/* Smartphones médios e pequenos (<= 480px) */
@media (max-width: 480px) {
    .auth-hero {
        min-height: 130px;
        max-height: 170px;
    }
    .auth-hero-content {
        padding: 1rem 0.85rem 0.85rem;
    }
    .auth-hero-content h1 {
        font-size: 1.25rem;
    }
    .auth-hero-stats {
        gap: 0.65rem;
        justify-content: space-between;
    }
    .auth-hero-stats strong {
        font-size: 1.15rem;
    }
    .auth-hero-stats span {
        font-size: 0.725rem;
    }
    .auth-form-side {
        padding: 1.25rem 1rem 2rem;
    }
    .auth-form-container {
        max-width: 100%;
    }
    .auth-logo {
        margin-bottom: 0.65rem;
    }
    .auth-logo img {
        max-width: 130px;
    }
    .auth-title {
        font-size: 1.25rem;
    }
    .auth-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 0.85rem;
    }
    .auth-input-wrap input,
    .auth-form .form-control {
        height: 44px;
        font-size: 16px; /* Evita zoom automático no iOS */
    }
    .auth-submit,
    .auth-btn {
        height: 46px;
    }
}

/* Smartphones muito estreitos (<= 340px) */
@media (max-width: 340px) {
    .auth-hero-stats {
        gap: 0.35rem;
    }
    .auth-hero-stats strong {
        font-size: 1rem;
    }
    .auth-hero-stats span {
        font-size: 0.7rem;
    }
    .auth-title {
        font-size: 1.15rem;
    }
    .auth-form-side {
        padding: 1rem 0.65rem 1.5rem;
    }
}
