/* Confia — componentes da Central do Assinante. Valores vêm de tokens.css; tipografia vem das classes de estilo (.body, .label…). */

body { margin: 0; font-family: var(--font-sans); background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
.cf-display { font-family: var(--font-display); font-weight: 900; font-stretch: 125%; text-transform: uppercase; }
.cf-overline { margin: 0; text-transform: uppercase; color: var(--ink-subtle); }
.cf-num { font-variant-numeric: tabular-nums; }
.cf-icon { flex: none; }
.cf-spin { animation: cf-spin 0.9s linear infinite; }
@keyframes cf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cf-spin, .cf-conn-pulse { animation: none; } }

/* Button */
.cf-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); box-sizing: border-box; border: 1.5px solid transparent; border-radius: var(--radius-full); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease-out, border-color .15s ease-out, transform .1s ease-out; -webkit-tap-highlight-color: transparent; }
.cf-btn-sm { height: var(--control-sm); padding: 0 var(--space-4); }
.cf-btn-md { height: var(--control-md); padding: 0 var(--space-5); }
.cf-btn-lg { height: var(--control-lg); padding: 0 var(--space-6); }
.cf-btn-block { display: flex; width: 100%; }
.cf-btn:active:not(:disabled) { transform: scale(.98); }
.cf-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cf-btn-primary { background: var(--primary); color: var(--on-primary); }
.cf-btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.cf-btn-secondary { background: var(--ink); color: var(--surface); }
.cf-btn-secondary:hover:not(:disabled) { background: var(--ink-muted); }
.cf-btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.cf-btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.cf-btn-ghost { background: transparent; color: var(--ink); }
.cf-btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }
.cf-btn-danger { background: var(--danger); color: var(--on-danger); }
.cf-btn:disabled { cursor: not-allowed; }
.cf-btn:disabled:not(.cf-btn-loading) { color: var(--ink-disabled); background: transparent; border-color: var(--line); }
.cf-btn-loading { cursor: progress; }

.cf-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; padding: 0; border-radius: var(--radius-full); background: transparent; color: var(--ink); cursor: pointer; position: relative; }
.cf-icon-btn:hover { background: var(--primary-soft); }
.cf-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* TextField */
.cf-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.cf-field-label { color: var(--ink); }
.cf-input-wrap { display: flex; align-items: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-3) 0 var(--space-4); box-sizing: border-box; background: var(--surface-raised); border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); color: var(--ink-subtle); transition: border-color .15s ease-out; }
.cf-input-wrap:hover { border-color: var(--ink-muted); }
.cf-input-wrap:focus-within { border-color: var(--focus); box-shadow: var(--focus-ring); }
.cf-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font-family: inherit; }
.cf-input::placeholder { color: var(--ink-subtle); opacity: 1; }
.cf-input-toggle { display: grid; place-items: center; width: 32px; height: 32px; border: 0; padding: 0; background: transparent; color: var(--ink-subtle); border-radius: var(--radius-full); cursor: pointer; }
.cf-input-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cf-input-suffix { color: var(--ink-subtle); }
.cf-field-msg { display: flex; align-items: center; gap: var(--space-1); margin: 0; color: var(--ink-subtle); }
.cf-field-error .cf-input-wrap { border-color: var(--danger); }
.cf-field-msg-error { color: var(--danger); }
.cf-field-disabled .cf-input-wrap { background: transparent; border-color: var(--line); }
.cf-field-disabled .cf-input, .cf-field-disabled .cf-field-label { color: var(--ink-disabled); }

/* Tabs */
.cf-tabs { display: inline-flex; width: fit-content; gap: var(--space-1); padding: var(--space-1); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-full); }
.cf-tabs-block { display: flex; width: auto; }
.cf-tabs-block .cf-tab { flex: 1; }
.cf-tab { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-sm); padding: 0 var(--space-4); border: 0; border-radius: var(--radius-full); background: transparent; color: var(--ink-subtle); font-family: inherit; cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
.cf-tab:hover { color: var(--ink); }
.cf-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cf-tab-active, .cf-tab-active:hover { background: var(--ink); color: var(--surface); }
.cf-tab-count { min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; display: inline-grid; place-items: center; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); }

/* Tones (Badge, Alert, ícones de status) */
.cf-tone-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.cf-tone-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.cf-tone-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.cf-tone-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.cf-tone-neutral { --tone: var(--ink-muted); --tone-soft: var(--surface); }

.cf-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 10px; box-sizing: border-box; border-radius: var(--radius-full); background: var(--tone-soft); color: var(--tone); font-weight: 600; white-space: nowrap; }
.cf-badge.cf-tone-neutral { border: 1px solid var(--line); }

.cf-alert { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--tone-soft); color: var(--ink); }
.cf-alert-icon { color: var(--tone); margin-top: 2px; }
.cf-alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.cf-alert-title { margin: 0; color: var(--ink); }
.cf-alert-text { color: var(--ink-muted); }
.cf-alert-text p { margin: 0; }
.cf-alert-action { margin-top: var(--space-2); }
.cf-alert-close { width: 32px; height: 32px; margin: -6px -6px 0 0; color: var(--ink-muted); }

/* Card */
.cf-card { position: relative; box-sizing: border-box; border-radius: var(--radius-lg); padding: var(--space-5); }
.cf-card-sm { padding: var(--space-4); }
.cf-card-flush { padding: 0; overflow: hidden; }
.cf-card-raised { background: var(--surface-raised); box-shadow: var(--shadow-sm); }
.cf-card-outline { background: transparent; border: 1px solid var(--line); }
.cf-card-feature { background: var(--surface-feature); color: var(--on-feature); border-radius: var(--radius-xl); padding: var(--space-6); overflow: hidden; --ink: var(--on-feature); --ink-muted: var(--on-feature); --ink-subtle: var(--lima); --line-strong: var(--cinza); --line: var(--grafite); --primary-soft: var(--grafite); --surface: var(--surface-feature); }
.cf-card-brand { background: var(--surface-brand); color: var(--on-brand); border-radius: var(--radius-xl); padding: var(--space-6); overflow: hidden; --ink: var(--on-brand); --ink-muted: var(--on-brand); --ink-subtle: var(--on-brand); --line-strong: var(--on-brand); --surface: var(--surface-brand); --focus: var(--marinho); --primary-soft: var(--lima); }
.cf-card-brand :focus-visible { box-shadow: 0 0 0 2px var(--verde), 0 0 0 4px var(--marinho) !important; }

/* ListItem */
.cf-list { display: flex; flex-direction: column; }
.cf-list > .cf-listitem + .cf-listitem { border-top: 1px solid var(--line); }
.cf-listitem { display: flex; align-items: center; gap: var(--space-3); width: 100%; box-sizing: border-box; min-height: 64px; padding: var(--space-3) var(--space-4); background: transparent; border: 0; color: var(--ink); text-align: left; text-decoration: none; font-family: inherit; }
.cf-listitem-action { cursor: pointer; }
.cf-listitem-action:hover { background: var(--surface); }
.cf-listitem-action:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.cf-listitem-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--tone-soft, var(--surface)); color: var(--tone, var(--ink)); }
.cf-listitem-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cf-listitem-title { color: var(--ink); }
.cf-listitem-desc { color: var(--ink-subtle); }
.cf-listitem-trailing { flex: none; color: var(--ink-muted); }
.cf-listitem-chevron { color: var(--ink-subtle); }

/* AppHeader */
.cf-appheader { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); height: var(--header-height); padding: 0 var(--space-4); box-sizing: border-box; background: var(--surface); color: var(--ink); }
.cf-appheader-greeting { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.cf-appheader-name, .cf-appheader-sub { margin: 0; }
.cf-appheader-sub { color: var(--ink-subtle); }
.cf-appheader-actions { display: flex; align-items: center; gap: var(--space-1); }
.cf-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; display: grid; place-items: center; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.cf-dot-sm { min-width: 0; width: 10px; height: 10px; padding: 0; top: 2px; right: 14px; }
.cf-avatar { width: 40px; height: 40px; border: 0; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-family: inherit; cursor: pointer; }
.cf-avatar:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* TabBar */
.cf-tabbar { display: flex; height: var(--tabbar-height); padding: 0 var(--space-2); background: var(--surface-raised); border-top: 1px solid var(--line); box-sizing: content-box; padding-bottom: env(safe-area-inset-bottom, 0px); }
.cf-tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: var(--ink-subtle); font-family: inherit; cursor: pointer; padding: 0; }
.cf-tabbar-item:focus-visible { outline: none; }
.cf-tabbar-item:focus-visible .cf-tabbar-pill { box-shadow: var(--focus-ring); }
.cf-tabbar-pill { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--radius-full); transition: background-color .15s ease-out; }
.cf-tabbar-active { color: var(--ink); }
.cf-tabbar-active .cf-tabbar-pill { background: var(--primary); color: var(--on-primary); }
.cf-tabbar-active .cf-tabbar-label { font-weight: 700; }

/* ConnectionStatus */
.cf-conn { display: flex; flex-direction: column; gap: var(--space-2); overflow: hidden; }
.cf-conn-art { position: absolute; right: -60px; top: -86px; opacity: .9; pointer-events: none; }
.cf-conn-top { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.cf-conn-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--tone-soft); color: var(--tone); }
.cf-card-brand .cf-conn-icon { background: var(--marinho); color: var(--verde); }
.cf-conn-live { display: inline-flex; align-items: center; gap: var(--space-2); height: 28px; padding: 0 12px 0 10px; border-radius: var(--radius-full); background: var(--marinho); color: var(--creme); font-weight: 600; }
.cf-conn-pulse { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--verde); box-shadow: 0 0 0 0 var(--verde); animation: cf-pulse 2s ease-out infinite; }
@keyframes cf-pulse { 0% { box-shadow: 0 0 0 0 #4dc345b3; } 70% { box-shadow: 0 0 0 8px #4dc34500; } 100% { box-shadow: 0 0 0 0 #4dc34500; } }
.cf-conn-title { position: relative; margin: 0; max-width: 22ch; }
.cf-conn-detail { position: relative; margin: 0; color: var(--ink-muted); }
.cf-conn-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }
.cf-conn-foot-stack { flex-direction: column; align-items: stretch; }
.cf-conn-foot-stack .cf-conn-actions { flex-direction: column; }
.cf-conn-time { color: var(--ink-subtle); }
.cf-conn-actions { display: flex; gap: var(--space-2); }

/* InvoiceCard */
.cf-invoice { display: flex; flex-direction: column; }
.cf-invoice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.cf-invoice-title { margin: 2px 0 0; }
.cf-invoice-amount { margin: var(--space-4) 0 var(--space-1); color: var(--ink); }
.cf-invoice-meta { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--ink-subtle); }
.cf-invoice-actions { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.cf-invoice-secondary { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.cf-invoice-secondary:empty { display: none; }
.cf-invoice-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; box-sizing: border-box; min-height: 72px; padding: var(--space-3) var(--space-4); border: 0; background: transparent; color: var(--ink); text-align: left; font-family: inherit; cursor: pointer; }
.cf-invoice-row:hover { background: var(--surface); }
.cf-invoice-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.cf-list > .cf-invoice-row + .cf-invoice-row { border-top: 1px solid var(--line); }
.cf-invoice-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cf-invoice-due { color: var(--ink-subtle); }
.cf-invoice-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.cf-invoice-row-side .amount { font-size: 18px; line-height: 24px; }

/* PlanCard */
.cf-plan { min-height: 260px; }
.cf-plan-art { position: absolute; right: -50px; top: -84px; pointer-events: none; }
.cf-plan-over { position: relative; color: var(--lima); }
.cf-plan-speed { position: relative; margin: var(--space-3) 0 0; }
.cf-plan-unit { font-size: .55em; letter-spacing: .04em; }
.cf-plan-name { position: relative; margin: var(--space-1) 0 0; }
.cf-plan-list { position: relative; list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); max-width: 70%; }
.cf-plan-list li { display: flex; align-items: center; gap: var(--space-2); }
.cf-plan-check { color: var(--verde); }
.cf-plan-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }
.cf-plan-price { display: flex; align-items: baseline; gap: var(--space-1); margin: 0; }

/* PixCode */
.cf-pix { display: flex; flex-direction: column; gap: var(--space-4); }
.cf-pix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.cf-pix-head p { margin: 0; }
.cf-pix-head .heading-sm { margin-top: 2px; }
.cf-pix-qr { display: grid; place-items: center; padding: var(--space-4); background: #ffffff; border-radius: var(--radius-md); align-self: center; }
.cf-pix-qr img { display: block; border-radius: var(--radius-sm); }
.cf-pix-qr-empty { width: 184px; height: 184px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); border: 1.5px dashed var(--cinza); border-radius: var(--radius-sm); color: #5a636c; }
.cf-pix-hint { margin: 0; color: var(--ink-muted); }
.cf-pix-code { padding: var(--space-3) var(--space-4); background: var(--surface); border-radius: var(--radius-sm); }
.cf-pix-code-text { color: var(--ink); word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cf-pix-foot { margin: 0; color: var(--ink-subtle); text-align: center; }
