/* AWA Round7 (dual-write hotfix): auth pages (B2B/PF) visual refinement */

:is(body.b2b-auth-shell, body.b2b-account-login, body.b2b-account-forgotpassword, body.b2b-account-claim, body.b2b-register-index) {
    --awa-auth-primary: var(--primary-color, #b73337);
    --awa-auth-primary-hover: var(--primary-hover, #8e2629);
    --awa-auth-focus: 0 0 0 3px rgb(183 51 55 / 18%);
    --awa-auth-border: #dfe5ee;
    --awa-auth-border-strong: #c7d2e1;
    --awa-auth-text: #1f2937;
    --awa-auth-muted: #64748b;
    --awa-auth-radius: 14px;
    --awa-auth-radius-lg: 18px;
    --awa-auth-shadow: 0 18px 44px rgb(15 23 42 / 10%);
    --awa-auth-soft: rgb(183 51 55 / 6%);
}

body.b2b-auth-shell .page_footer,
body.b2b-register-index.page-layout-empty .page_footer {
    display: none !important;
}

:is(body.b2b-auth-shell, body.b2b-register-index) .page.messages {
    position: relative;
    z-index: 2;
}

:is(body.b2b-auth-shell, body.b2b-register-index) .message {
    border-radius: 12px;
    border: 1px solid var(--awa-auth-border);
    box-shadow: 0 6px 16px rgb(15 23 42 / 5%);
}

.b2b-login-page {
    font-family: var(--font-family, 'Inter', sans-serif);
    color: var(--awa-auth-text);
    background:
        radial-gradient(circle at 8% -8%, rgb(183 51 55 / 12%), transparent 42%),
        radial-gradient(circle at 92% 8%, rgb(142 38 41 / 10%), transparent 38%),
        linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
}

.b2b-login-logo {
    backdrop-filter: saturate(1.1) blur(2px);
    background: rgb(255 255 255 / 96%);
}

.b2b-login-card {
    border-radius: var(--awa-auth-radius-lg);
    border-color: var(--awa-auth-border);
    box-shadow: var(--awa-auth-shadow);
}

.b2b-login-title {
    color: #111827;
    letter-spacing: -0.02em;
}

.b2b-login-subtitle {
    color: var(--awa-auth-muted);
}

.b2b-field-label {
    color: #334155;
    font-weight: 700;
}

.b2b-field input {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--awa-auth-border-strong);
    background: #fff;
    color: var(--awa-auth-text);
    padding-inline: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.b2b-field input::placeholder {
    color: #94a3b8;
}

.b2b-field input:hover {
    border-color: #b8c4d6;
}

.b2b-field input:focus,
.b2b-field input:focus-visible {
    border-color: var(--awa-auth-primary);
    box-shadow: var(--awa-auth-focus);
    outline: 0;
}

.b2b-field-note,
.b2b-login-forgot span {
    color: var(--awa-auth-muted);
}

.b2b-login-forgot a,
.b2b-login-footer a,
.b2b-register-page .terms-section .label a,
.b2b-register-page .actions-toolbar .secondary a,
.b2b-register-page a {
    color: var(--awa-auth-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.14em;
}

.b2b-login-forgot a:hover,
.b2b-login-footer a:hover,
.b2b-register-page .terms-section .label a:hover,
.b2b-register-page .actions-toolbar .secondary a:hover,
.b2b-register-page a:hover {
    color: var(--awa-auth-primary-hover);
}

.b2b-password-wrap,
.b2b-register-password-wrap {
    border-radius: 12px;
}

.b2b-password-toggle,
.b2b-register-page .b2b-register-password-toggle {
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    color: var(--awa-auth-primary);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.b2b-password-toggle:hover,
.b2b-register-page .b2b-register-password-toggle:hover {
    background: var(--awa-auth-soft);
    color: var(--awa-auth-primary-hover);
}

.b2b-password-toggle:focus-visible,
.b2b-register-page .b2b-register-password-toggle:focus-visible {
    outline: 0;
    box-shadow: var(--awa-auth-focus);
}

.b2b-login-actions,
.b2b-login-ctas {
    width: 100%;
}

.b2b-btn-entrar,
.b2b-btn-register,
.b2b-btn-claim,
.b2b-register-page .action.submit.primary.create-b2b-account {
    min-height: 48px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.b2b-btn-entrar,
.b2b-register-page .action.submit.primary.create-b2b-account {
    background: var(--awa-auth-primary);
    border-color: var(--awa-auth-primary);
    color: #fff;
    box-shadow: 0 10px 22px rgb(183 51 55 / 22%);
}

.b2b-btn-entrar:hover,
.b2b-register-page .action.submit.primary.create-b2b-account:hover {
    background: var(--awa-auth-primary-hover);
    border-color: var(--awa-auth-primary-hover);
    box-shadow: 0 14px 26px rgb(142 38 41 / 24%);
    transform: translateY(-1px);
}

.b2b-btn-register,
.b2b-btn-claim {
    border: 1px solid var(--awa-auth-border);
    background: #fff;
    box-shadow: 0 4px 12px rgb(15 23 42 / 5%);
}

.b2b-btn-register:hover,
.b2b-btn-claim:hover {
    border-color: rgb(183 51 55 / 36%);
    background: rgb(183 51 55 / 4%);
    transform: translateY(-1px);
}

.b2b-btn-entrar:focus-visible,
.b2b-btn-register:focus-visible,
.b2b-btn-claim:focus-visible,
.b2b-login-whatsapp:focus-visible,
.b2b-register-page .action.submit.primary.create-b2b-account:focus-visible,
.b2b-register-page .b2b-benefits-toggle:focus-visible,
.b2b-register-page .progress-step:focus-visible,
.b2b-register-page .actions-toolbar .secondary a:focus-visible {
    outline: 0;
    box-shadow: var(--awa-auth-focus);
}

.b2b-login-whatsapp {
    border-radius: 12px;
    border: 1px solid rgb(37 211 102 / 18%);
    background: #fff;
    box-shadow: 0 4px 12px rgb(15 23 42 / 5%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.b2b-login-whatsapp:hover {
    border-color: rgb(37 211 102 / 34%);
    box-shadow: 0 10px 22px rgb(37 211 102 / 12%);
    transform: translateY(-1px);
}

.b2b-register-page {
    font-family: var(--font-family, 'Inter', sans-serif);
}

html body .page-wrapper .b2b-register-page .b2b-register-container {
    border-radius: var(--awa-auth-radius-lg);
    border-color: var(--awa-auth-border);
    box-shadow: var(--awa-auth-shadow);
}

html body .page-wrapper .b2b-register-page .register-header .register-title {
    color: #111827;
    letter-spacing: -0.02em;
}

html body .page-wrapper .b2b-register-page .register-header .subtitle,
html body .page-wrapper .b2b-register-page .register-header .register-trust-note {
    color: var(--awa-auth-muted);
}

.b2b-register-page .register-meta__item {
    border-color: var(--awa-auth-border);
    border-radius: 12px;
}

.b2b-register-page .register-meta__item:hover {
    border-color: rgb(183 51 55 / 22%);
    box-shadow: 0 8px 18px rgb(15 23 42 / 6%);
}

.b2b-register-page .b2b-benefits-toggle {
    min-height: 48px;
    border-radius: 14px;
    border-color: rgb(183 51 55 / 18%);
    box-shadow: 0 6px 16px rgb(15 23 42 / 5%);
}

.b2b-register-page .b2b-benefits-toggle[aria-expanded='true'] {
    border-color: rgb(183 51 55 / 28%);
    background: linear-gradient(180deg, #fff, rgb(183 51 55 / 3%));
}

.b2b-register-page .b2b-register-form .field .input-text,
.b2b-register-page .b2b-register-form select,
.b2b-register-page .b2b-register-form textarea {
    min-height: 48px;
    border-radius: 12px;
    border-color: var(--awa-auth-border-strong);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.b2b-register-page .b2b-register-form textarea {
    min-height: 104px;
    padding-top: 12px;
    resize: vertical;
}

.b2b-register-page .b2b-register-form .field .input-text:focus,
.b2b-register-page .b2b-register-form .field .input-text:focus-visible,
.b2b-register-page .b2b-register-form select:focus,
.b2b-register-page .b2b-register-form select:focus-visible,
.b2b-register-page .b2b-register-form textarea:focus,
.b2b-register-page .b2b-register-form textarea:focus-visible {
    border-color: var(--awa-auth-primary);
    box-shadow: var(--awa-auth-focus);
    outline: 0;
}

.b2b-register-page .progress-step {
    min-height: 44px;
    border-radius: 999px;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.b2b-register-page .progress-step:hover {
    border-color: rgb(183 51 55 / 22%);
}

.b2b-register-page .progress-step.is-active,
.b2b-register-page .progress-step[aria-current='step'] {
    border-color: rgb(183 51 55 / 34%);
    box-shadow: 0 6px 14px rgb(183 51 55 / 10%);
}

.b2b-register-page .progress-step__num {
    background: var(--awa-auth-primary);
    color: #fff;
}

.b2b-register-page .actions-toolbar {
    gap: 14px;
}

.b2b-register-page .actions-toolbar .secondary {
    border-radius: 12px;
    border: 1px solid var(--awa-auth-border);
    background: #fff;
    padding: 12px 14px;
}

.b2b-register-page .actions-toolbar .secondary a {
    font-weight: 600;
}

.b2b-register-page .terms-section .label {
    line-height: 1.45;
}

.b2b-register-page .terms-section .checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--awa-auth-primary);
}

.b2b-register-page .actions-primary-note {
    color: var(--awa-auth-muted);
}

:is(body.b2b-auth-shell, body.b2b-register-index) a:focus-visible {
    outline: 0;
    box-shadow: var(--awa-auth-focus);
    border-radius: 8px;
}

/* AWA Round12: login/register conversion structure refinement */
.b2b-login-page {
    min-height: 100svh;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 12px;
    padding: clamp(16px, 3vw, 28px) 14px 24px;
}

.b2b-login-logo,
.b2b-login-card,
.b2b-login-footer,
.b2b-register-shell-content {
    width: min(100%, 468px);
    margin-inline: auto;
}

.b2b-login-form {
    display: grid;
    gap: 14px;
}

.b2b-field {
    display: grid;
    gap: 6px;
}

.b2b-field.b2b-field-password .b2b-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.b2b-field.b2b-field-password .b2b-password-wrap input {
    width: 100%;
    padding-inline-end: 98px;
}

.b2b-field.b2b-field-password .b2b-password-wrap .b2b-password-toggle {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 82px;
    min-height: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.b2b-login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--awa-auth-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.b2b-login-divider::before,
.b2b-login-divider::after {
    content: '';
    height: 1px;
    flex: 1 1 auto;
    background: var(--awa-auth-border);
}

.b2b-login-ctas {
    display: grid;
    gap: 10px;
}

.b2b-login-ctas .b2b-btn-register,
.b2b-login-ctas .b2b-btn-claim {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    padding: 8px 12px;
}

.b2b-login-ctas .b2b-btn-register strong,
.b2b-login-ctas .b2b-btn-claim strong {
    margin-inline-start: 4px;
}

.b2b-login-footer {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.b2b-login-footer-brand {
    color: #111827;
    font-weight: 700;
}

.b2b-login-footer-contact {
    color: var(--awa-auth-muted);
}

.b2b-login-form .mage-error {
    display: block;
    margin-top: 4px;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.3;
}

/* Keep auth conversion path clear: avoid floating chrome covering CTA/actions. */
:is(body.b2b-auth-shell, body.b2b-register-index) .awa-whatsapp-float,
:is(body.b2b-auth-shell, body.b2b-register-index) .awa-nav-overlay {
    display: none !important;
}

.b2b-login-card {
    padding: clamp(28px, 3vw, 36px) clamp(18px, 3vw, 28px) clamp(24px, 3vw, 30px);
}

.b2b-login-actions .b2b-btn-entrar {
    width: 100%;
    letter-spacing: 0.06em;
}

.b2b-login-forgot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
}

@media (width <= 767px) {
    .b2b-login-page {
        padding: 12px 10px calc(20px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .b2b-login-logo,
    .b2b-login-card,
    .b2b-login-footer,
    .b2b-register-shell-content {
        width: min(100%, 420px);
    }

    .b2b-login-card {
        margin-top: 18px;
        border-radius: 16px;
        padding: 24px 16px 20px;
        box-shadow: 0 10px 24px rgb(15 23 42 / 8%);
    }

    .b2b-login-logo {
        padding: 14px 0 10px;
    }

    .b2b-login-forgot {
        justify-content: flex-start;
        margin-top: 2px;
    }

    .b2b-login-divider {
        margin: 12px 0;
    }

    .b2b-field.b2b-field-password .b2b-password-wrap .b2b-password-toggle {
        min-width: 76px;
        min-height: 36px;
        height: 36px;
        inset-inline-end: 4px;
    }

    .b2b-btn-register,
    .b2b-btn-claim,
    .b2b-btn-entrar,
    .b2b-register-page .action.submit.primary.create-b2b-account,
    .b2b-login-whatsapp,
    .b2b-register-page .b2b-benefits-toggle,
    .b2b-register-page .progress-step {
        min-height: 44px;
    }

    .b2b-register-page .register-meta {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .b2b-register-page .b2b-benefits {
        padding: 14px;
        border-radius: 14px;
        gap: 12px;
    }

    html body .page-wrapper .b2b-register-page .b2b-register-container {
        border-radius: 16px;
        box-shadow: 0 10px 24px rgb(15 23 42 / 8%);
    }

    .b2b-register-page .actions-toolbar .secondary {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .b2b-password-toggle,
    .b2b-register-page .b2b-register-password-toggle,
    .b2b-btn-entrar,
    .b2b-btn-register,
    .b2b-btn-claim,
    .b2b-login-whatsapp,
    .b2b-register-page .action.submit.primary.create-b2b-account,
    .b2b-register-page .progress-step,
    .b2b-register-page .benefit-item,
    .b2b-register-page .benefit-icon,
    .b2b-login-card,
    .b2b-register-page .register-meta__item {
        transition: none;
        animation: none;
    }
}
