/*
 * BoxLevel Auth Shortcode — Estilos
 * Versão: 1.3.1
 *
 * Namespace: .bla-  (todos os seletores estão isolados)
 * Sem conflito com temas, Elementor ou outros plugins.
 */

/* ── Tokens de design ─────────────────────────────────────────────────────── */
.bla-wrapper {
    --bla-accent:        #3d86ff;
    --bla-accent-hover:  #2b6fe0;
    --bla-accent-light:  #eef4ff;
    --bla-accent-rgb:    61, 134, 255;

    --bla-success:       #16a34a;
    --bla-success-light: #f0fdf4;
    --bla-error:         #dc2626;
    --bla-error-light:   #fef2f2;
    --bla-warn:          #d97706;

    --bla-bg:            #ffffff;
    --bla-surface:       #f8fafc;
    --bla-border:        #e2e8f0;
    --bla-border-focus:  #3d86ff;
    --bla-text:          #0f172a;
    --bla-text-muted:    #64748b;
    --bla-placeholder:   #a0aec0;

    --bla-radius-sm:     8px;
    --bla-radius:        14px;
    --bla-radius-lg:     20px;

    --bla-shadow:        none;
    --bla-shadow-focus:  none;
    --bla-shadow-btn:    none;

    --bla-transition:    160ms cubic-bezier(.4, 0, .2, 1);
    --bla-font:          -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    --bla-icon-size:     16px;
    --bla-icon-left:     14px;
    --bla-input-pl:      42px;
    --bla-input-pr:      42px;
}

/* ── Reset de box-sizing isolado ──────────────────────────────────────────── */
.bla-wrapper,
.bla-wrapper *,
.bla-wrapper *::before,
.bla-wrapper *::after {
    box-sizing: border-box;
}

/*
 * RESET GLOBAL DE ESTADOS INTERATIVOS
 * Impede que Elementor, WooCommerce, OceanWP, Avada e outros temas
 * sobrescrevam cores via :hover, :active, :visited, :focus, :any-link.
 * Cobre o caso do middle-click + arrastar que fica com cor do tema.
 */

/* Neutraliza qualquer cor de link/botão injetada pelo tema dentro do wrapper */
.bla-wrapper a,
.bla-wrapper a:link,
.bla-wrapper a:visited,
.bla-wrapper a:hover,
.bla-wrapper a:active,
.bla-wrapper a:focus,
.bla-wrapper a:any-link {
    color: inherit !important;
    text-decoration: none !important;
    background-color: transparent !important;
}

.bla-wrapper button,
.bla-wrapper button:link,
.bla-wrapper button:visited,
.bla-wrapper button:hover,
.bla-wrapper button:focus,
.bla-wrapper button:focus-visible,
.bla-wrapper button:active,
.bla-wrapper button:any-link {
    background-image: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* ── Container principal ──────────────────────────────────────────────────── */
.bla-wrapper {
    display: block;
    width: 100%;
    max-width: 440px;
    margin: 2.5rem auto;

    background: var(--bla-bg);
    border: 1px solid var(--bla-border);
    border-radius: var(--bla-radius-lg);
    box-shadow: none;
    overflow: hidden;

    font-family: var(--bla-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--bla-text);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Views (Main ↔ Recover) ───────────────────────────────────────────────── */
.bla-view { display: block; }
.bla-view[hidden] { display: none; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.bla-tabs {
    position: relative;
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid var(--bla-border);
    padding: 6px 6px 0;
    gap: 2px;
}

.bla-tab {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    text-shadow: none !important;

    flex: 1;
    position: relative;
    z-index: 1;
    padding: 10px 16px 12px !important;
    border-radius: var(--bla-radius-sm) var(--bla-radius-sm) 0 0 !important;

    font-family: var(--bla-font) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    letter-spacing: 0.01em !important;
    text-align: center !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;

    transition: color var(--bla-transition), background var(--bla-transition) !important;
}

/* Todos os estados pseudo do tab inativo */
.bla-tab:link,
.bla-tab:visited,
.bla-tab:focus,
.bla-tab:focus:not(:focus-visible),
.bla-tab:any-link {
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

.bla-tab:hover:not(.bla-tab--active),
.bla-tab:focus:hover:not(.bla-tab--active) {
    color: var(--bla-text) !important;
    -webkit-text-fill-color: var(--bla-text) !important;
    background: #f8fafc !important;
    border-color: transparent !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Middle-click + arrastar: estado :active isolado */
.bla-tab:active:not(.bla-tab--active) {
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    background: #f1f5f9 !important;
    border-color: transparent !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

.bla-tab:focus-visible {
    outline: 2px solid var(--bla-accent) !important;
    outline-offset: -2px;
}

/* Tab ativo — todos os estados pseudo explícitos */
.bla-tab--active,
.bla-tab--active:link,
.bla-tab--active:visited,
.bla-tab--active:hover,
.bla-tab--active:focus,
.bla-tab--active:focus:not(:focus-visible),
.bla-tab--active:active,
.bla-tab--active:any-link {
    color: var(--bla-accent) !important;
    -webkit-text-fill-color: var(--bla-accent) !important;
    background: #ffffff !important;
    background-image: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Linha indicadora animada */
.bla-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.5px;
    width: 50%;
    background: #3d86ff !important;
    border-radius: 2px 2px 0 0;
    transition: left var(--bla-transition), width var(--bla-transition);
    pointer-events: none;
    z-index: 2;
}

/* ── Painéis ──────────────────────────────────────────────────────────────── */
.bla-panel {
    padding: 26px 30px 30px;
}

.bla-panel[hidden] { display: none; }

.bla-panel__subtitle {
    margin: 0 0 20px;
    font-size: 0.875rem;
    color: var(--bla-text-muted);
    line-height: 1.5;
}

/* ── Aviso (erro / sucesso) ───────────────────────────────────────────────── */
.bla-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 18px;
    border-radius: var(--bla-radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.45;
    animation: bla-notice-in 200ms ease;
}

.bla-notice[hidden] { display: none; }

.bla-notice--error {
    background: #fef2f2;
    color: var(--bla-error);
    border: 1px solid rgba(220, 38, 38, 0.18);
}

.bla-notice--success {
    background: #eef4ff;
    color: var(--bla-accent-hover);
    border: 1px solid rgba(61, 134, 255, 0.22);
}

@keyframes bla-notice-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Formulário ───────────────────────────────────────────────────────────── */
.bla-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ── Campo ────────────────────────────────────────────────────────────────── */
.bla-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bla-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bla-text);
    letter-spacing: 0.01em;
    margin: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: none;
    float: none;
    width: auto;
}

.bla-field__hint {
    font-size: 0.75rem;
    color: var(--bla-text-muted);
    margin: 0;
    padding: 0;
}

/* ── Input wrapper ────────────────────────────────────────────────────────── */
.bla-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* ── Ícone decorativo (lado esquerdo) ────────────────────────────────────── */
.bla-input-icon {
    position: absolute;
    top: 50%;
    left: var(--bla-icon-left);
    transform: translateY(-50%);
    width: var(--bla-icon-size);
    height: var(--bla-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    color: var(--bla-placeholder);
    transition: color var(--bla-transition);
    flex-shrink: 0;
    line-height: 1;
}

.bla-input-icon svg {
    display: block;
    width: var(--bla-icon-size);
    height: var(--bla-icon-size);
    flex-shrink: 0;
}

/* ── Input ────────────────────────────────────────────────────────────────── */
.bla-input {
    display: block;
    width: 100%;
    position: relative;
    z-index: 0;

    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: var(--bla-input-pl) !important;
    padding-right: var(--bla-input-pr) !important;

    background: var(--bla-bg) !important;
    border: 1.5px solid var(--bla-border) !important;
    border-radius: var(--bla-radius-sm) !important;
    box-shadow: none !important;
    outline: none !important;

    font-family: var(--bla-font) !important;
    font-size: 0.9375rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    color: var(--bla-text) !important;
    letter-spacing: 0 !important;

    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0;

    transition: border-color var(--bla-transition) !important;
}

.bla-input::placeholder {
    color: var(--bla-placeholder) !important;
    opacity: 1;
}

.bla-input:hover:not(:focus) {
    border-color: #b0bec5 !important;
}

.bla-input:focus {
    border-color: var(--bla-border-focus) !important;
    box-shadow: none !important;
    background: var(--bla-bg) !important;
}

.bla-input-wrap:focus-within .bla-input-icon {
    color: var(--bla-accent);
}

/* ── Grid de campos ───────────────────────────────────────────────────────── */
.bla-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.bla-field-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Botão olho (toggle visibilidade de senha) ───────────────────────────── */
.bla-eye-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;

    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    color: var(--bla-placeholder) !important;
    -webkit-text-fill-color: var(--bla-placeholder) !important;
    fill: none !important;

    transition: color var(--bla-transition);
}

.bla-eye-btn:link,
.bla-eye-btn:visited,
.bla-eye-btn:any-link {
    color: var(--bla-placeholder) !important;
    -webkit-text-fill-color: var(--bla-placeholder) !important;
}

.bla-eye-btn:hover {
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    background: transparent !important;
}

.bla-eye-btn:active {
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    background: transparent !important;
}

.bla-eye-btn:focus-visible {
    outline: 2px solid var(--bla-accent) !important;
    outline-offset: -3px;
    border-radius: 4px !important;
}

.bla-eye-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 16px;
    height: 16px;
    pointer-events: none;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.bla-icon-eye { display: none !important; }
.bla-icon-eye-off { display: block !important; }
.bla-eye-btn[aria-pressed="true"] .bla-icon-eye { display: block !important; }
.bla-eye-btn[aria-pressed="true"] .bla-icon-eye-off { display: none !important; }

/* ── Link "Esqueceu a senha?" ─────────────────────────────────────────────── */
.bla-forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.bla-link-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none;
    cursor: pointer;
    text-decoration: none !important;
    text-shadow: none !important;

    font-family: var(--bla-font) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #3d86ff !important;
    -webkit-text-fill-color: #3d86ff !important;
    line-height: 1.4;

    transition: color var(--bla-transition);
}

.bla-link-btn:link,
.bla-link-btn:visited,
.bla-link-btn:any-link {
    color: #3d86ff !important;
    -webkit-text-fill-color: #3d86ff !important;
}

.bla-link-btn:hover {
    color: #2b6fe0 !important;
    -webkit-text-fill-color: #2b6fe0 !important;
    text-decoration: underline !important;
    background: transparent !important;
}

.bla-link-btn:active {
    color: #2b6fe0 !important;
    -webkit-text-fill-color: #2b6fe0 !important;
    background: transparent !important;
}

.bla-link-btn:focus-visible {
    outline: 2px solid #3d86ff;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── Medidor de força de senha ────────────────────────────────────────────── */
.bla-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.bla-strength__bar {
    flex: 1;
    height: 4px;
    background: var(--bla-border);
    border-radius: 99px;
    overflow: hidden;
}

.bla-strength__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width 280ms ease, background 280ms ease;
}

.bla-strength__fill[data-level="1"] { width: 25%;  background: var(--bla-error); }
.bla-strength__fill[data-level="2"] { width: 50%;  background: var(--bla-warn);  }
.bla-strength__fill[data-level="3"] { width: 75%;  background: #84cc16;          }
.bla-strength__fill[data-level="4"] { width: 100%; background: var(--bla-success); }

.bla-strength__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bla-text-muted);
    white-space: nowrap;
    min-width: 62px;
    transition: color var(--bla-transition);
}

/* ── Botão de envio ───────────────────────────────────────────────────────── */
.bla-tabs button,
.bla-forgot button,
.bla-recover-header button,
.bla-btn {
    background-image: none !important;
}

.bla-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    outline: none;
    text-decoration: none !important;
    text-shadow: none !important;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px !important;
    margin-top: 4px;

    background: var(--bla-accent) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: var(--bla-radius-sm) !important;
    box-shadow: none !important;
    cursor: pointer;

    font-family: var(--bla-font) !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.4 !important;
    text-align: center;

    transition: background var(--bla-transition), opacity var(--bla-transition) !important;
}

.bla-btn:link,
.bla-btn:visited,
.bla-btn:any-link {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: var(--bla-accent) !important;
}

.bla-btn:hover:not(:disabled) {
    background: var(--bla-accent-hover) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.bla-btn:active:not(:disabled) {
    background: var(--bla-accent-hover) !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
}

.bla-btn:focus-visible {
    outline: 2px solid var(--bla-accent) !important;
    outline-offset: 2px;
}

.bla-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    box-shadow: none !important;
}

.bla-btn--loading .bla-btn__label { opacity: 0; }
.bla-btn--loading .bla-btn__spinner { display: block; }

.bla-btn__spinner {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bla-spin 0.65s linear infinite;
}

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

/* ── Vista de recuperação de senha ───────────────────────────────────────── */
.bla-recover-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 30px 14px;
    border-bottom: 1px solid var(--bla-border);
    background: #ffffff;
}

.bla-recover-title {
    margin: 0;
    padding: 0;
    font-family: var(--bla-font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--bla-text);
    line-height: 1.3;
    border: none;
    background: none;
}

.bla-back-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 5px 8px 5px 4px !important;
    margin: 0 !important;
    outline: none;
    cursor: pointer;
    text-decoration: none !important;
    text-shadow: none !important;
    border-radius: var(--bla-radius-sm) !important;

    display: inline-flex;
    align-items: center;
    gap: 4px;

    font-family: var(--bla-font) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    line-height: 1;

    transition: color var(--bla-transition), background var(--bla-transition);
    flex-shrink: 0;
}

.bla-back-btn:link,
.bla-back-btn:visited,
.bla-back-btn:any-link {
    color: var(--bla-text-muted) !important;
    -webkit-text-fill-color: var(--bla-text-muted) !important;
    background: transparent !important;
}

.bla-back-btn:hover {
    color: #3d86ff !important;
    -webkit-text-fill-color: #3d86ff !important;
    background: var(--bla-accent-light) !important;
}

.bla-back-btn:active {
    color: #2b6fe0 !important;
    -webkit-text-fill-color: #2b6fe0 !important;
    background: var(--bla-accent-light) !important;
}

.bla-back-btn:focus-visible {
    outline: 2px solid var(--bla-accent) !important;
    outline-offset: 1px;
}

.bla-back-btn svg {
    display: block;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.bla-panel-body {
    padding: 22px 30px 30px;
}

.bla-panel-body .bla-panel__subtitle {
    margin-bottom: 18px;
}



/* ── Blindagem extra contra cores herdadas do tema/Elementor ─────────────── */
.bla-wrapper .bla-tab,
.bla-wrapper .bla-tab *,
.bla-wrapper .bla-btn,
.bla-wrapper .bla-btn *,
.bla-wrapper .bla-link-btn,
.bla-wrapper .bla-link-btn *,
.bla-wrapper .bla-back-btn,
.bla-wrapper .bla-back-btn *,
.bla-wrapper .bla-eye-btn,
.bla-wrapper .bla-eye-btn *,
.bla-wrapper .blap-btn-secondary,
.bla-wrapper .blap-btn-secondary * {
    fill: currentColor;
    stroke: currentColor;
}

.bla-wrapper .bla-tab,
.bla-wrapper .bla-tab:hover,
.bla-wrapper .bla-tab:focus,
.bla-wrapper .bla-tab:focus-visible,
.bla-wrapper .bla-tab:active,
.bla-wrapper .bla-tab--active,
.bla-wrapper .bla-tab--active:hover,
.bla-wrapper .bla-tab--active:focus,
.bla-wrapper .bla-tab--active:active {
    box-shadow: none !important;
}

/* ── Responsividade ───────────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .bla-wrapper {
        margin: 1.25rem auto;
        border-radius: var(--bla-radius);
        max-width: 100%;
    }
    .bla-panel,
    .bla-panel-body {
        padding: 20px 18px 24px;
    }
    .bla-recover-header {
        padding: 16px 18px 12px;
    }
    .bla-input {
        font-size: 1rem !important;
    }
}

@media (max-width: 360px) {
    .bla-panel,
    .bla-panel-body {
        padding: 16px 14px 20px;
    }
    .bla-tab {
        font-size: 0.8125rem !important;
        padding: 9px 8px 11px !important;
    }
    .bla-recover-header {
        padding: 14px 14px 10px;
    }
}

@media (max-width: 640px) {
    .bla-field-grid--2 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bla-wrapper *,
    .bla-wrapper *::before,
    .bla-wrapper *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
