/*
 * Tela de login BolarBras (admin + área do cliente).
 * Usada por application/views/authentication/my_login_admin.php e
 * application/views/themes/perfex/views/my_login.php.
 * Também padroniza as demais telas de autenticação do admin
 * (esqueci a senha, redefinir senha, 2FA).
 */
:root {
    --bb-auth-bg: #FFF4EA;
    --bb-auth-bg-2: #FFE7D1;
    --bb-auth-orange: #E85D04;
    --bb-auth-orange-dark: #C24E03;
    --bb-auth-orange-soft: rgba(232, 93, 4, .14);
    --bb-auth-text: #1F2937;
    --bb-auth-muted: #6B7280;
    --bb-auth-border: #E5E7EB;
    --bb-auth-input-border: #D6DAE0;
    --bb-auth-danger: #B42318;
}

/* ---------- Fundo ---------- */
body.customers_login,
body.login_admin,
body.authentication {
    min-height: 100vh;
    background-color: var(--bb-auth-bg) !important;
    background-image:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .85) 0, rgba(255, 255, 255, 0) 38%),
        radial-gradient(circle at 88% 92%, var(--bb-auth-bg-2) 0, rgba(255, 231, 209, 0) 45%) !important;
    background-attachment: fixed !important;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--bb-auth-text);
}

/* ---------- Estrutura ---------- */
.bb-auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;
}

.bb-auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid rgba(232, 93, 4, .10);
    border-radius: 20px;
    box-shadow: 0 24px 60px -18px rgba(154, 52, 18, .22), 0 2px 6px rgba(15, 23, 42, .04);
    padding: 40px 40px 34px;
    box-sizing: border-box;
}

.bb-auth-logo,
.bb-auth-logo.company-logo {
    text-align: center;
    margin: 0 0 22px;
    padding: 0;
}

.bb-auth-logo a,
.bb-auth-logo img {
    display: inline-block !important;
}

.bb-auth-logo img {
    max-height: 110px;
    max-width: 240px;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.bb-auth-title {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--bb-auth-text);
    text-align: center;
    margin: 0 0 6px;
    letter-spacing: -.01em;
}

.bb-auth-subtitle {
    font-size: 15px;
    color: var(--bb-auth-muted);
    text-align: center;
    margin: 0 0 28px;
}

.bb-auth-footer {
    margin-top: 22px;
    font-size: 12.5px;
    color: #9A6B4B;
    text-align: center;
}

/* ---------- Campos ---------- */
.bb-auth-field {
    margin-bottom: 20px;
}

.bb-auth-field label,
.bb-auth-card label.control-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.bb-auth-input {
    position: relative;
}

.bb-auth-input .bb-auth-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--bb-auth-orange);
    pointer-events: none;
}

.bb-auth-card .form-control {
    height: 48px !important;
    border-radius: 12px !important;
    border: 1px solid var(--bb-auth-input-border) !important;
    background: #FCFCFD;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--bb-auth-text);
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.bb-auth-input .form-control {
    padding-left: 44px;
}

.bb-auth-input.has-toggle .form-control {
    padding-right: 46px;
}

.bb-auth-card .form-control::placeholder {
    color: #A0A7B2;
}

.bb-auth-card .form-control:hover {
    border-color: #F3B58A !important;
}

.bb-auth-card .form-control:focus {
    border-color: var(--bb-auth-orange) !important;
    background: #fff;
    box-shadow: 0 0 0 4px var(--bb-auth-orange-soft) !important;
    outline: none;
}

.bb-auth-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color .15s ease, background-color .15s ease;
}

.bb-auth-toggle:hover,
.bb-auth-toggle:focus-visible {
    color: var(--bb-auth-orange);
    background: var(--bb-auth-orange-soft);
    outline: none;
}

.bb-auth-toggle svg {
    width: 18px;
    height: 18px;
}

.bb-auth-toggle .bb-eye-off {
    display: none;
}

.bb-auth-toggle.is-visible .bb-eye {
    display: none;
}

.bb-auth-toggle.is-visible .bb-eye-off {
    display: block;
}

/* ---------- Lembrar / esqueci ---------- */
.bb-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 24px;
}

.bb-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500 !important;
    color: #4B5563;
}

.bb-auth-check input[type=checkbox] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--bb-auth-orange);
    cursor: pointer;
}

.bb-auth-link,
.bb-auth-card a.bb-auth-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--bb-auth-orange) !important;
    text-decoration: none;
    transition: color .15s ease;
}

.bb-auth-link:hover,
.bb-auth-link:focus {
    color: var(--bb-auth-orange-dark) !important;
    text-decoration: underline;
}

/* ---------- Botões ---------- */
.bb-auth-card .btn.bb-auth-btn,
.bb-auth-card .btn-primary,
body.login_admin .btn-primary,
body.authentication .btn-primary {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 12px !important;
    border: 0 !important;
    background: linear-gradient(180deg, #F26A12 0%, var(--bb-auth-orange) 100%) !important;
    color: #fff !important;
    font-size: 15.5px;
    font-weight: 600 !important;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px -8px rgba(232, 93, 4, .7);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.bb-auth-card .btn.bb-auth-btn:hover,
.bb-auth-card .btn-primary:hover,
body.login_admin .btn-primary:hover,
body.authentication .btn-primary:hover {
    background: linear-gradient(180deg, var(--bb-auth-orange) 0%, var(--bb-auth-orange-dark) 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -10px rgba(194, 78, 3, .75);
}

.bb-auth-card .btn.bb-auth-btn:active,
.bb-auth-card .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px -6px rgba(194, 78, 3, .7);
}

.bb-auth-card .btn.bb-auth-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--bb-auth-orange-soft);
}

.bb-auth-card .btn-default.bb-auth-btn-outline {
    display: block;
    width: 100%;
    height: 46px;
    line-height: 30px;
    margin-top: 12px;
    border-radius: 12px !important;
    border: 1px solid #F3B58A !important;
    background: #fff !important;
    color: var(--bb-auth-orange) !important;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease;
}

.bb-auth-card .btn-default.bb-auth-btn-outline:hover {
    background: #FFF4EA !important;
    border-color: var(--bb-auth-orange) !important;
}

/* ---------- Alertas e erros ---------- */
.bb-auth-card .alert {
    border-radius: 12px;
    font-size: 14px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-width: 1px;
}

.bb-auth-card .alert-danger {
    background: #FEF3F2;
    border-color: #FECDCA;
    color: var(--bb-auth-danger);
}

.bb-auth-card .alert-success {
    background: #ECFDF3;
    border-color: #ABEFC6;
    color: #067647;
}

.bb-auth-card .alert-warning,
.bb-auth-card .alert-info {
    background: #FFF7ED;
    border-color: #FED7AA;
    color: #9A3412;
}

.bb-auth-card .alert p {
    margin: 0;
}

.bb-auth-card .alert p + p {
    margin-top: 4px;
}

.bb-auth-card #alerts,
.bb-auth-card > .row {
    margin-left: 0;
    margin-right: 0;
}

.bb-auth-card #alerts {
    padding: 0;
}

.bb-auth-card .text-danger,
.bb-auth-card .alert-validation {
    display: block;
    color: var(--bb-auth-danger) !important;
    font-size: 13px;
    margin: 6px 0 0;
}

.bb-auth-field.has-error .form-control {
    border-color: #F97066 !important;
}

.bb-auth-field.has-error .form-control:focus {
    box-shadow: 0 0 0 4px rgba(240, 68, 56, .14) !important;
}

.bb-auth-card .g-recaptcha {
    margin-bottom: 20px;
}

/* ---------- Área do cliente (layout do tema) ---------- */
body.customers_login #wrapper,
body.customers_login #content,
body.customers_login .content {
    background: transparent !important;
}

body.customers_login .bb-auth-wrap--customers {
    min-height: auto;
    padding: 32px 16px 56px;
}

body.customers_login .bb-auth-card .panel_s,
body.customers_login .bb-auth-card .panel-body {
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: none;
}

body.customers_login .bb-auth-card .panel_s {
    overflow: visible !important;
}

body.customers_login .bb-auth-card .bootstrap-select.form-control {
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent;
    box-shadow: none !important;
}

body.customers_login .bb-auth-card .bootstrap-select > .dropdown-toggle {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--bb-auth-input-border);
    background: #FCFCFD;
    box-shadow: none;
    padding-left: 14px;
    display: flex;
    align-items: center;
}

body.customers_login .bb-auth-card .bootstrap-select > .dropdown-toggle .filter-option {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: var(--bb-auth-text);
}

body.customers_login .bb-auth-card .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    line-height: 1.4;
}

body.customers_login .bb-auth-card .bootstrap-select.open > .dropdown-toggle,
body.customers_login .bb-auth-card .bootstrap-select > .dropdown-toggle:focus {
    border-color: var(--bb-auth-orange);
    box-shadow: 0 0 0 4px var(--bb-auth-orange-soft);
    outline: none !important;
}

body.customers_login .bb-auth-card .btn-default.bb-auth-btn-outline {
    padding: 0 !important;
    line-height: 44px;
}

/* ---------- Demais telas de autenticação do admin ---------- */
body.authentication .authentication-form-wrappe,
body.authentication .authentication-form-wrapper,
body.login_admin .authentication-form-wrapper {
    padding-top: 64px !important;
}

body.authentication .tw-bg-white {
    border-radius: 20px !important;
    border-color: rgba(232, 93, 4, .10) !important;
    box-shadow: 0 24px 60px -18px rgba(154, 52, 18, .22), 0 2px 6px rgba(15, 23, 42, .04) !important;
}

body.authentication .form-control {
    height: 48px;
    border-radius: 12px;
    border-color: var(--bb-auth-input-border);
    box-shadow: none;
}

body.authentication .form-control:focus {
    border-color: var(--bb-auth-orange);
    box-shadow: 0 0 0 4px var(--bb-auth-orange-soft);
}

body.authentication a {
    color: var(--bb-auth-orange);
}

body.authentication .company-logo img {
    max-height: 72px;
    width: auto;
}

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
    .bb-auth-wrap {
        justify-content: flex-start;
        padding: 28px 14px;
    }

    .bb-auth-card {
        padding: 30px 22px 26px;
        border-radius: 18px;
    }

    .bb-auth-logo {
        margin-bottom: 20px;
    }

    .bb-auth-logo img {
        max-height: 92px;
        max-width: 200px;
    }

    .bb-auth-title {
        font-size: 21px;
    }

    body.customers_login .bb-auth-wrap--customers {
        padding: 16px 0 40px;
    }

    .bb-auth-subtitle {
        font-size: 14px;
        margin-bottom: 22px;
    }
}

@media (max-height: 640px) and (min-width: 481px) {
    .bb-auth-wrap {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-auth-card .btn,
    .bb-auth-card .form-control {
        transition: none;
    }
}
