/* ===== Wallet page + Bank Link modal (mobile-first) ===== */

.wallet-container {
    padding: 16px 16px 32px;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

.wallet-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.wallet-header-add {
    width: auto;
    min-width: 0;
    padding: 10px 14px;
    font-size: 0.85rem;
}

.wallet-accounts-heading {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary, #6b7c8e);
}

.wallet-accounts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

/* ---- Card shell ---- */
.wallet-account-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px 22px 20px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 22px 44px -20px rgba(15, 23, 42, 0.55),
        0 2px 6px rgba(15, 23, 42, 0.12);
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    isolation: isolate;
}

/* Soft top sheen + grounded base — subtle depth, no glow */
.wallet-account-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(130% 90% at 88% -10%, rgba(255, 255, 255, 0.16), transparent 55%),
        radial-gradient(90% 70% at 0% 120%, rgba(0, 0, 0, 0.18), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* Faint concentric watermark, bottom-right — premium detail */
.wallet-account-card::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 26px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 0;
}

.wallet-account-card > * {
    position: relative;
    z-index: 1;
}

.wallet-account-card-pj {
    background: linear-gradient(155deg, #12203a 0%, #1e3253 46%, #2a4a72 100%);
}

.wallet-account-card-pf {
    background: linear-gradient(155deg, #c9520a 0%, #e56f1c 46%, #f28b3c 100%);
}

/* ---- Header: eyebrow + quiet actions ---- */
.wallet-account-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wallet-account-card-kind {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-account-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wallet-account-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    color: #fff;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.wallet-account-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
}

.wallet-account-btn:active {
    transform: translateY(1px);
}

.wallet-account-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.wallet-account-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-account-btn-danger {
    border-color: rgba(255, 194, 194, 0.4);
    background: rgba(80, 16, 16, 0.26);
}

.wallet-account-btn-danger:hover {
    background: rgba(120, 24, 24, 0.4);
    border-color: rgba(255, 194, 194, 0.6);
}

/* ---- Body: bank name hero + balance ---- */
.wallet-account-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 16px;
}

.wallet-account-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wallet-account-brand-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

.wallet-account-bank {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-account-balance-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-account-balance-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}

.wallet-account-balance {
    font-size: 1.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.wallet-account-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: -4px;
}

.wallet-account-pager-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wallet-account-pager-nav {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.42);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.wallet-account-pager-nav:hover:not(:disabled) {
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
}

.wallet-account-pager-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wallet-account-pager-nav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.wallet-account-pager-chevron {
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
}

.wallet-account-pager-chevron.is-prev {
    transform: rotate(135deg);
    margin-left: 2px;
}

.wallet-account-pager-chevron.is-next {
    transform: rotate(-45deg);
    margin-right: 2px;
}

.wallet-account-pager-dot {
    appearance: none;
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 0.18s ease, background 0.15s ease, opacity 0.15s ease;
}

.wallet-account-pager-dot:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.65);
}

.wallet-account-pager-dot.is-active {
    width: 22px;
    background: rgba(255, 255, 255, 0.95);
}

.wallet-account-pager-dot:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-account-pager-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ---- Empty state: balanced, centered ---- */
.wallet-account-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 8px 4px;
    min-height: 128px;
}

.wallet-account-empty-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 2px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    position: relative;
}

.wallet-account-empty-icon::before,
.wallet-account-empty-icon::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

.wallet-account-empty-icon::before {
    width: 18px;
    height: 2px;
    left: 14px;
    top: 22px;
}

.wallet-account-empty-icon::after {
    width: 2px;
    height: 18px;
    left: 22px;
    top: 14px;
}

.wallet-account-empty-title {
    font-size: 0.98rem;
    font-weight: 600;
}

.wallet-account-empty-hint {
    max-width: 26ch;
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.72;
}

.wallet-account-empty-cta {
    margin-top: 8px;
}

/* ---- Statement toggle + panel ---- */
.wallet-account-statement {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-account-tx-toggle {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    align-self: stretch;
    width: 100%;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wallet-account-tx-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.34);
}

.wallet-account-tx-toggle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wallet-account-tx-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.wallet-account-tx-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.wallet-account-tx-toggle.is-open .wallet-account-tx-chevron {
    transform: translateY(2px) rotate(225deg);
}

.wallet-account-tx-panel {
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 14px;
    max-height: 260px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    animation: wallet-stmt-in 0.22s ease both;
}

@keyframes wallet-stmt-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wallet-account-tx-heading {
    display: block;
    margin-bottom: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    opacity: 0.62;
}

.wallet-account-tx-more {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wallet-account-tx-more:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}

.wallet-account-tx-more:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wallet-account-tx-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.wallet-account-tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-account-tx-item:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.wallet-account-tx-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Down arrow (debit) / up arrow (credit) drawn with borders */
.wallet-account-tx-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.wallet-account-tx-icon.is-debit {
    color: rgba(255, 255, 255, 0.85);
}

.wallet-account-tx-icon.is-debit::before {
    transform: translate(-50%, -60%) rotate(45deg);
}

.wallet-account-tx-icon.is-credit {
    color: #9ff0bb;
}

.wallet-account-tx-icon.is-credit::before {
    transform: translate(-50%, -40%) rotate(-135deg);
}

.wallet-account-card-pf .wallet-account-tx-icon.is-credit {
    color: #eafff0;
}

.wallet-account-tx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-account-tx-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-account-tx-date {
    font-size: 0.7rem;
    opacity: 0.62;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.wallet-account-tx-amount {
    flex-shrink: 0;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.wallet-account-tx-amount.is-debit {
    color: rgba(255, 255, 255, 0.92);
}

.wallet-account-tx-amount.is-credit {
    color: #b8f5cb;
}

.wallet-account-card-pf .wallet-account-tx-amount.is-credit {
    color: #eafff0;
}

.wallet-account-tx-status {
    margin: 6px 2px;
    font-size: 0.78rem;
    opacity: 0.8;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .wallet-account-tx-panel {
        animation: none;
    }

    .wallet-account-tx-chevron {
        transition: none;
    }
}

.wallet-inline-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, #e74c3c 12%, var(--card-bg, #fff));
    color: var(--text-color, #3d5268);
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .wallet-container {
        padding: 24px 28px 40px;
    }

    .wallet-title {
        font-size: 1.75rem;
    }

    .wallet-accounts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
        align-items: start;
    }

    .wallet-account-card {
        padding: 24px 24px 22px;
        min-height: 224px;
    }

    .wallet-account-bank {
        font-size: 1.42rem;
    }

    .wallet-account-balance {
        font-size: 1.9rem;
    }
}

/* ===== Bank Link modal ===== */

.banklink-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    box-sizing: border-box;
}

/* Mobile: jornada abaixo do .top-header (56px), cabeçalho permanece visível como no Figma */
@media (max-width: 767px) {
    .banklink-modal-overlay {
        inset: auto;
        top: 56px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90; /* abaixo de .top-header (z-index: 100) */
        background: var(--bg-color, #fff);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        cursor: default;
    }
}

.banklink-modal {
    --banklink-blue: #2f80ed;
    --banklink-blue-soft: #e8f1fc;
    --banklink-text: #2c3e50;
    --banklink-muted: #8a97a8;
    --banklink-border: #d9dee7;

    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    max-height: 100%;
    background: var(--card-bg, #fff);
    overflow: auto;
    cursor: default;
    box-sizing: border-box;
}

.banklink-modal-image {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    background: #0b1220;
    flex-shrink: 0;
    /* Mobile (success etc.): imagem no topo — cantos inferiores arredondados */
    border-radius: 0 0 16px 16px;
}

/* Intro/Country: aside image only on desktop (md+) */
.banklink-modal-intro .banklink-hero-aside,
.banklink-modal-country .banklink-hero-aside {
    display: none;
}

.banklink-modal-hero {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Mobile inline hero (Intro between title/features; Country at top) — Figma 1:1 */
.banklink-hero-inline {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #0b1220;
    flex-shrink: 0;
    box-sizing: border-box;
}

.banklink-hero-inline-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.banklink-modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 18px 24px;
    flex: 1;
    min-height: 0;
}

.banklink-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

/* Figma mobile Intro/Country: sem stepper dots / X */
.banklink-modal-intro .banklink-modal-top,
.banklink-modal-country .banklink-modal-top {
    display: none;
}

.banklink-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
    justify-content: center;
}

.banklink-intro {
    gap: 16px;
}

/* Coluna compartilhada: pretitle + título + imagem (mesma largura) */
.banklink-intro-media {
    --banklink-intro-media-width: 100%;
    width: var(--banklink-intro-media-width);
    max-width: var(--banklink-intro-media-width);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-sizing: border-box;
}

.banklink-intro-media .banklink-pretitle,
.banklink-intro-media .banklink-intro-title,
.banklink-intro-media .banklink-hero-inline {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.banklink-intro .banklink-pretitle,
.banklink-intro .banklink-title {
    text-align: center;
}

.banklink-intro-title {
    line-height: 1.3;
    text-align: center;
}

.banklink-intro-title-desktop {
    display: none;
}

.banklink-intro-title-mobile {
    display: block;
    width: 100%;
    text-align: center;
}

.banklink-intro-title-line {
    display: block;
    white-space: nowrap;
}

.banklink-intro .banklink-features {
    text-align: left;
    align-self: stretch;
}

.banklink-country {
    gap: 16px;
    text-align: center;
    align-items: stretch;
    /* Step 2: conteúdo próximo do topo */
    justify-content: flex-start;
}

.banklink-country .banklink-hero-inline {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.banklink-country .banklink-pretitle,
.banklink-country .banklink-title {
    text-align: center;
}

.banklink-country .banklink-select-wrap {
    width: 100%;
    text-align: left;
}

@media (max-width: 767px) {
    .banklink-intro-media {
        width: 100%;
        max-width: 100%;
    }

    .banklink-intro-title-mobile {
        display: block;
        width: 100%;
        max-width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* Steps 1–2: coluna única — conteúdo rola (sem barra), botões fixos no rodapé */
    .banklink-modal.banklink-modal-intro,
    .banklink-modal.banklink-modal-country {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .banklink-modal-intro .banklink-modal-content,
    .banklink-modal-country .banklink-modal-content {
        flex: 1;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-top: 12px;
        padding-bottom: 16px;
    }

    .banklink-modal-intro .banklink-intro,
    .banklink-modal-country .banklink-country {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        justify-content: flex-start;
        gap: 12px;
        padding-bottom: 8px;
        padding-top: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .banklink-modal-intro .banklink-intro::-webkit-scrollbar,
    .banklink-modal-country .banklink-country::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .banklink-modal-intro .banklink-actions,
    .banklink-modal-country .banklink-actions {
        flex-shrink: 0;
        margin-top: 0;
        padding-top: 12px;
        padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
        background: var(--card-bg, #fff);
        position: relative;
        z-index: 2;
    }

    /* Step 1: imagem 1x1 em toda a largura útil (margem = padding do content) */
    .banklink-modal-intro .banklink-hero-inline {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
        margin-inline: 0;
        flex-shrink: 0;
    }

    /* Step 2: mesma largura útil 1x1 */
    .banklink-modal-country .banklink-hero-inline {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        margin-inline: 0;
        flex-shrink: 0;
    }

    /* Step 3: mesmos botões / coluna das telas anteriores */
    .banklink-modal.banklink-modal-auth {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .banklink-modal-auth .banklink-auth {
        flex: 1;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .banklink-modal-auth .banklink-auth-header {
        flex: 0 0 auto;
        min-height: 120px;
        max-height: 26vh;
        height: 26vh;
    }

    .banklink-modal-auth .banklink-auth-panel {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        align-items: stretch;
        padding: 20px 18px 0;
        gap: 0;
    }

    .banklink-modal-auth .banklink-auth-scroll {
        flex: 1 1 0;
        min-height: 0;
        align-items: stretch;
        text-align: center;
        padding-bottom: 8px;
    }

    .banklink-modal-auth .banklink-auth-input,
    .banklink-modal-auth .banklink-auth-panel .banklink-error {
        max-width: none;
    }

    .banklink-modal-auth .banklink-auth > .banklink-auth-actions {
        flex-shrink: 0;
        width: 100%;
        max-width: none;
        margin-top: 0;
        padding: 12px 18px max(16px, env(safe-area-inset-bottom, 0px));
        background: var(--card-bg, #fff);
        position: relative;
        z-index: 2;
        box-sizing: border-box;
    }
}

@media (max-width: 767px) and (max-height: 700px) {
    .banklink-modal-intro .banklink-intro,
    .banklink-modal-country .banklink-country {
        gap: 10px;
    }

    .banklink-modal-intro .banklink-features {
        gap: 8px;
        font-size: 0.875rem;
    }

    .banklink-modal-intro .banklink-connected-badge {
        padding: 10px 14px;
        font-size: 0.8125rem;
    }
}

.banklink-modal-steps {
    display: flex;
    gap: 8px;
    align-items: center;
}

.banklink-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c9d4e3;
    flex-shrink: 0;
}

.banklink-step-dot.active {
    width: 36px;
    height: 8px;
    border-radius: 999px;
    background: var(--banklink-blue);
}

.banklink-step-dot.completed {
    background: var(--banklink-blue);
}

.banklink-close {
    appearance: none;
    border: none;
    background: transparent;
    color: #6b7788;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.banklink-close:hover {
    background: color-mix(in srgb, var(--banklink-text) 6%, transparent);
}

.banklink-pretitle {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--banklink-muted);
    line-height: 1.4;
}

.banklink-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--banklink-text);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Mobile Step 1: DEPOIS de .banklink-title (senão 1.35rem vence) — 3 linhas fixas */
@media (max-width: 767px) {
    .banklink-intro .banklink-title.banklink-intro-title {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        font-size: clamp(1.85rem, 6.2vw, 2.35rem);
        line-height: 1.25;
        letter-spacing: -0.02em;
        text-align: center;
        box-sizing: border-box;
    }

    .banklink-intro-title-line {
        display: block;
        white-space: nowrap;
    }
}

.banklink-features {
    margin: 4px 0 0;
    padding-left: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #5b6b7c;
    font-size: 0.9375rem;
    line-height: 1.55;
    list-style: disc;
}

.banklink-features li::marker {
    color: #9aa8b8;
}

.banklink-features strong {
    color: var(--banklink-text);
    font-weight: 700;
}

.banklink-connected-badge {
    margin-top: 4px;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--banklink-blue-soft);
    color: #3d5a80;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.banklink-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--banklink-text);
}

.banklink-select-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--banklink-border);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--card-bg, #fff);
}

.banklink-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.banklink-select,
.banklink-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--banklink-text);
    font-size: 1rem;
    padding: 12px 0;
    outline: none;
}

.banklink-input {
    border: 1px solid var(--banklink-border);
    border-radius: 10px;
    padding: 12px 14px;
    box-sizing: border-box;
    background: var(--card-bg, #fff);
}

.banklink-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
}

.banklink-actions-stack {
    flex-direction: column;
}

.banklink-btn {
    appearance: none;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    line-height: 1.2;
}

.banklink-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.banklink-btn-primary {
    border: none;
    background: var(--banklink-blue);
    color: #fff;
}

.banklink-btn-primary:hover {
    filter: brightness(1.05);
}

.banklink-btn-outline {
    border: 1px solid var(--banklink-border);
    background: #fff;
    color: var(--banklink-text);
}

.banklink-btn-outline:hover {
    background: #f7f9fb;
}

.banklink-error {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, #e74c3c 12%, var(--card-bg, #fff));
    color: var(--banklink-text);
    font-size: 0.9rem;
}

.banklink-auth-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0b1220;
    margin: -4px 0 4px;
}

.banklink-auth-hero-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    opacity: 0.9;
}

.banklink-auth-brands {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 60%);
}

.banklink-brand {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.banklink-brand-of {
    font-weight: 500;
    opacity: 0.95;
}

.banklink-auth-body {
    margin: 0;
    font-weight: 700;
    color: var(--banklink-text);
    line-height: 1.45;
}

.banklink-auth-secure,
.banklink-auth-partner,
.banklink-waiting-message {
    margin: 0;
    color: var(--banklink-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ===== TaxId / Open Finance auth (Figma step 3) ===== */

.banklink-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.banklink-modal.banklink-modal-auth {
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.banklink-modal.banklink-modal-auth::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.banklink-auth {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--card-bg, #fff);
    overflow: hidden;
}

.banklink-auth-header {
    position: relative;
    flex: 0 0 38%;
    min-height: 160px;
    overflow: hidden;
    background: #05080f;
    border-radius: 0 0 16px 16px;
}

.banklink-auth-header-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.banklink-auth-logos {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 16px;
    pointer-events: none;
}

.banklink-auth-logo {
    height: auto;
    max-height: 36px;
    width: auto;
    max-width: 46%;
    object-fit: contain;
    /* Logos brancos em PNG com fundo preto → fundem no header escuro */
    mix-blend-mode: screen;
}

.banklink-auth-logo-jr {
    max-height: 28px;
}

.banklink-auth-logo-of {
    max-height: 38px;
}

.banklink-auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    color: rgba(255, 255, 255, 0.85);
}

.banklink-auth-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.banklink-auth-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 20px 36px 0;
    text-align: center;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.banklink-auth-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.banklink-auth-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.banklink-auth-panel .banklink-auth-body {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    max-width: 36rem;
    line-height: 1.4;
}

.banklink-auth-panel .banklink-auth-secure,
.banklink-auth-panel .banklink-auth-partner {
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 34rem;
    line-height: 1.5;
}

.banklink-auth-panel .banklink-auth-partner {
    margin-top: -4px;
}

.banklink-auth-input {
    width: 100%;
    max-width: 420px;
    margin-top: 8px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #cfd6de;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--banklink-text);
}

.banklink-auth-input::placeholder {
    color: #9aa3af;
    text-align: center;
}

/* Actions fora do panel (irmão do header/panel) — mesmo padrão Steps 1–2 */
.banklink-auth > .banklink-auth-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: 100%;
    max-width: none;
    margin-top: 0;
    padding: 12px 36px 32px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.banklink-auth-submit,
.banklink-auth-back {
    width: 100%;
}

.banklink-auth-panel .banklink-error {
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.banklink-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 24px 8px;
    margin: auto 0;
}

.banklink-success-title {
    text-align: center;
    font-size: 1.75rem;
}

.banklink-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: banklink-spin 0.8s linear infinite;
}

.banklink-spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: color-mix(in srgb, var(--banklink-blue) 25%, transparent);
    border-top-color: var(--banklink-blue);
}

@keyframes banklink-spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 768px) {
    .banklink-modal-overlay {
        align-items: center;
        padding: 24px;
    }

    .banklink-modal {
        /* Altura fixa em todos os steps — evita “pulo” ao avançar */
        --banklink-modal-height: min(620px, calc(100vh - 48px));

        display: grid;
        grid-template-columns: 40% 60%;
        width: min(99vw, 945px);
        height: var(--banklink-modal-height);
        min-height: var(--banklink-modal-height);
        max-height: var(--banklink-modal-height);
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
    }

    .banklink-modal-intro,
    .banklink-modal-country {
        grid-template-columns: 42% 58%;
    }

    .banklink-modal-success {
        grid-template-columns: 40% 60%;
    }

    .banklink-modal-auth,
    .banklink-modal-waiting {
        grid-template-columns: 1fr;
    }

    .banklink-modal-auth {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .banklink-modal-auth::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .banklink-modal-auth .banklink-auth {
        flex: 1;
        min-height: 0;
    }

    .banklink-auth-header {
        flex: 0 0 46%;
        min-height: 206px;
        border-radius: 0 0 20px 20px;
    }

    .banklink-auth-logos {
        padding: 0 40px;
    }

    .banklink-auth-logo-jr {
        max-height: 32px;
    }

    .banklink-auth-logo-of {
        max-height: 46px;
    }

    .banklink-auth-panel {
        padding: 20px 48px 0;
        gap: 14px;
        justify-content: flex-start;
    }

    .banklink-auth-panel .banklink-auth-body {
        font-size: 1.125rem;
    }

    .banklink-auth > .banklink-auth-actions {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        max-width: none;
        padding: 16px 48px 36px;
    }

    .banklink-auth > .banklink-auth-actions .banklink-auth-submit,
    .banklink-auth > .banklink-auth-actions .banklink-auth-back {
        flex: 1;
        width: auto;
        max-width: 210px;
    }

    .banklink-modal-image {
        max-height: none;
        height: 100%;
        align-self: stretch;
        /* Desktop: cantos arredondados à direita (encontro com o painel de conteúdo) */
        border-radius: 0 20px 20px 0;
    }

    .banklink-modal-intro .banklink-hero-aside,
    .banklink-modal-country .banklink-hero-aside {
        display: block;
    }

    .banklink-hero-inline {
        display: none;
    }

    .banklink-intro-media {
        display: contents;
        width: auto;
        max-width: none;
        margin: 0;
    }

    .banklink-modal-intro .banklink-modal-top,
    .banklink-modal-country .banklink-modal-top {
        display: flex;
    }

    .banklink-modal-intro .banklink-modal-image,
    .banklink-modal-country .banklink-modal-image,
    .banklink-modal-success .banklink-modal-image {
        border-radius: 0 20px 20px 0;
    }

    .banklink-modal-hero {
        min-height: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .banklink-modal-content {
        padding: 28px 36px 28px 32px;
        justify-content: flex-start;
        gap: 0;
        min-height: 0;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .banklink-modal-content-full {
        justify-content: flex-start;
    }

    .banklink-modal-waiting .banklink-modal-content {
        justify-content: center;
    }

    .banklink-modal-body {
        gap: 16px;
        padding: 8px 0;
    }

    .banklink-country {
        justify-content: center;
        flex: 1;
        text-align: left;
    }

    .banklink-intro .banklink-pretitle,
    .banklink-intro .banklink-title,
    .banklink-country .banklink-pretitle,
    .banklink-country .banklink-title {
        text-align: left;
    }

    .banklink-intro .banklink-title {
        font-size: 1.5rem;
        width: auto;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        line-height: 1.25;
        text-align: left;
    }

    .banklink-intro-title-mobile {
        display: none;
    }

    .banklink-intro-title-desktop {
        display: block;
        text-align: left;
    }

    .banklink-intro .banklink-features {
        margin-top: 2px;
        gap: 14px;
        font-size: 0.9375rem;
    }

    .banklink-intro .banklink-connected-badge {
        margin-top: 8px;
        max-width: 100%;
    }

    .banklink-actions {
        flex-shrink: 0;
        margin-top: auto;
        padding-top: 20px;
        flex-direction: row;
        justify-content: flex-end;
        gap: 12px;
    }

    .banklink-actions-stack {
        flex-direction: column;
    }

    .banklink-btn {
        width: auto;
        min-width: 120px;
        padding: 10px 22px;
    }

    .banklink-actions-stack .banklink-btn {
        width: 100%;
    }

    .banklink-waiting {
        margin: 0;
        height: 100%;
        justify-content: center;
    }
}

[data-theme="dark"] .banklink-modal {
    --banklink-text: var(--text-color, #e8eef5);
    --banklink-muted: var(--text-secondary, #9aa8b8);
    --banklink-border: color-mix(in srgb, var(--text-color, #fff) 18%, transparent);
    --banklink-blue-soft: color-mix(in srgb, var(--banklink-blue) 22%, transparent);
}

[data-theme="dark"] .banklink-btn-outline {
    background: transparent;
    color: var(--banklink-text);
}

[data-theme="dark"] .banklink-features {
    color: var(--banklink-muted);
}

[data-theme="dark"] .banklink-features strong {
    color: var(--banklink-text);
}

[data-theme="dark"] .wallet-inline-error,
[data-theme="dark"] .banklink-error {
    background: color-mix(in srgb, #e74c3c 22%, transparent);
}
