:root {
    --bg: #edf4fa;
    --surface: #ffffff;
    --surface-soft: #f5f9fc;
    --ink: #102033;
    --muted: #647487;
    --line: #d6e2ec;
    --primary: #1769aa;
    --primary-dark: #0f4f84;
    --success: #087a4b;
    --danger: #b42318;
    --shadow: 0 18px 48px rgba(16, 50, 80, 0.14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(23, 105, 170, 0.18), transparent 34%),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button, a { touch-action: manipulation; }

.portal-shell {
    width: min(100%, 780px);
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 2px 18px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(23, 105, 170, 0.28);
}

.brand div { display: grid; }
.brand strong { font-size: 1.12rem; }
.brand span:last-child { color: var(--muted); font-size: .82rem; }

.consult-card,
.statement-card {
    border: 1px solid rgba(183, 201, 217, .75);
    border-radius: 26px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow);
}

.consult-card { padding: clamp(22px, 5vw, 34px); }
.card-heading { text-align: center; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); }
.card-heading > p:last-child { margin: 8px auto 0; color: var(--muted); }

.message { margin: 20px 0 0; border-radius: 14px; padding: 12px 14px; font-weight: 700; text-align: center; }
.message-error { border: 1px solid #fecaca; background: #fff1f2; color: var(--danger); }
.message-notice { border: 1px solid #bfdbfe; background: #eff6ff; color: var(--primary-dark); }

.scan-panel { display: grid; justify-items: center; gap: 10px; margin-top: 24px; }
.scan-button {
    min-height: 56px;
    border: 0;
    border-radius: 17px;
    padding: 0 24px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 850;
    box-shadow: 0 12px 26px rgba(23, 105, 170, .28);
    cursor: pointer;
}
.scan-button:disabled { opacity: .65; cursor: wait; }
.scan-icon { display: inline-block; width: 15px; height: 15px; margin-right: 8px; border: 3px solid currentColor; vertical-align: -2px; }
#preview { display: none; width: min(100%, 440px); border-radius: 18px; background: #07111d; aspect-ratio: 4 / 3; object-fit: cover; }
#preview.is-visible { display: block; }
.helper { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }

.identifier-form { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.identifier-form label { display: block; margin-bottom: 7px; color: #34485d; font-size: .88rem; font-weight: 800; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.input-row input {
    min-width: 0;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 0 14px;
    color: var(--ink);
    font-size: 16px;
    outline: 0;
}
.input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23, 105, 170, .16); }
.input-row button {
    min-height: 54px;
    border: 0;
    border-radius: 15px;
    padding: 0 18px;
    background: #dcecf8;
    color: var(--primary-dark);
    font-weight: 850;
    cursor: pointer;
}

.customer-account-callout {
    display: grid;
    gap: 5px;
    margin-top: 22px;
    border-radius: 18px;
    padding: 17px;
    background: var(--surface-soft);
    text-align: center;
}
.customer-account-callout span { color: var(--muted); font-size: .88rem; }
.customer-account-callout a {
    justify-self: center;
    margin-top: 7px;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}

.balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    border-radius: 23px;
    padding: 22px;
    background: linear-gradient(135deg, #0f4f84, #1769aa);
    color: #fff;
    box-shadow: 0 18px 38px rgba(15, 79, 132, .25);
}
.balance-card p { margin: 0 0 3px; color: #d8ebfa; font-size: .84rem; }
.balance-card strong { font-size: clamp(1.8rem, 8vw, 2.65rem); letter-spacing: -.04em; }
.account-chip { display: grid; justify-items: end; }
.account-chip span { font-weight: 800; }
.account-chip small { color: #d8ebfa; }

.statement-card { margin-top: 18px; overflow: hidden; }
.statement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 16px; }
.statement-heading h2 { font-size: 1.45rem; }
.statement-heading a { border-radius: 999px; padding: 8px 12px; background: #e9f2f9; color: var(--primary-dark); font-size: .82rem; font-weight: 800; text-decoration: none; }
.statement-content { padding: 0 14px 14px; }
.statement-content .card-transacao { color: #eef6fc; }

footer { padding: 20px 10px 0; color: var(--muted); font-size: .76rem; text-align: center; }

@media (max-width: 560px) {
    .input-row { grid-template-columns: 1fr; }
    .input-row button { width: 100%; }
    .balance-card { align-items: flex-start; flex-direction: column; }
    .account-chip { justify-items: start; }
}
