/*
 * Páginas "Conta e acessos" (account/access.php) e "Instalar o app"
 * (pwa/install.php). Valem em qualquer largura; usam só os tokens --portal-*.
 */

.pa-page, .pw-page { max-width: 720px; }
.pa-ico { width: 20px; height: 20px; flex: 0 0 auto; }

/* ── Conta e acessos ───────────────────────────────────────────────── */
.pa-card { border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); }
.pa-block { margin-top: 28px; }
.pa-title { margin: 0 0 10px; font-size: 1.05rem; font-weight: 750; line-height: 1.25; color: var(--portal-ink); }
.pa-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pa-count { font-size: .82rem; color: var(--portal-muted); white-space: nowrap; }
.pa-hint { margin: -4px 0 12px; font-size: .88rem; line-height: 1.45; color: var(--portal-muted); }

.pa-identity { display: grid; gap: 14px; padding: 18px; }
.pa-identity__who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pa-identity__text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.pa-identity__text strong { font-size: 1.1rem; font-weight: 750; line-height: 1.25; color: var(--portal-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-identity__text span { font-size: .88rem; color: var(--portal-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-identity__note { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--portal-muted); }
.pa-identity__cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px; font-weight: 650; }
.pa-identity__cta .pa-ico { width: 18px; height: 18px; }
.pa-tier { flex: 0 0 auto; padding: 5px 10px; border: 1px solid var(--portal-border); border-radius: 999px; font-size: .7rem; font-weight: 750; letter-spacing: .08em; line-height: 1; color: var(--portal-ink); }
.pa-tier[data-tier="PRO"], .pa-tier[data-tier="PLUS"] { border-color: color-mix(in srgb, var(--portal-brand) 55%, transparent); color: var(--portal-brand); }

.pa-plan { display: grid; gap: 10px; padding: 18px; margin-bottom: 10px; }
.pa-plan__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.pa-plan__tier { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; color: var(--portal-ink); }
.pa-plan[data-tier="PRO"] .pa-plan__tier, .pa-plan[data-tier="PLUS"] .pa-plan__tier { color: var(--portal-brand); }
.pa-plan__scope { font-size: .85rem; color: var(--portal-muted); }
.pa-plan__copy { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--portal-muted); }
.pa-plan__upgrade { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 4px; border-radius: 12px; }

.pa-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); overflow: hidden; }
.pa-list > li + li { border-top: 1px solid var(--portal-border); }
.pa-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px 10px 16px; color: var(--portal-ink); text-decoration: none; }
a.pa-row:hover, a.pa-row:focus-visible { background: color-mix(in srgb, var(--portal-ink) 5%, transparent); color: var(--portal-ink); }
a.pa-row:focus-visible, .pa-identity__cta:focus-visible { outline: 2px solid var(--portal-brand); outline-offset: -2px; }
.pa-row__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: var(--portal-surface-2); color: var(--portal-ink); }
.pa-row__text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.pa-row__text strong { font-size: .96rem; font-weight: 650; line-height: 1.3; color: var(--portal-ink); }
.pa-row__text span { font-size: .82rem; line-height: 1.4; color: var(--portal-muted); }
.pa-row__end { width: 18px; height: 18px; color: var(--portal-muted); }
.pa-list.is-muted .pa-row__text strong { color: var(--portal-muted); }
.pa-list.is-muted .pa-row__icon { color: var(--portal-muted); }

.pa-empty { display: grid; justify-items: start; gap: 4px; padding: 18px; }
.pa-empty strong { font-size: .98rem; color: var(--portal-ink); }
.pa-empty span { font-size: .88rem; color: var(--portal-muted); }
.pa-empty .btn { margin-top: 10px; min-height: 40px; }

/* ── Instalar o app ────────────────────────────────────────────────── */
.pw-ic { width: 1.05em; height: 1.05em; vertical-align: -.16em; }
.pw-hero { display: grid; justify-items: center; gap: 12px; padding: 8px 0 4px; text-align: center; }
.pw-hero h1 { margin: 6px 0 0; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; color: var(--portal-ink); text-wrap: balance; }
.pw-lead { max-width: 30rem; margin: 0; font-size: .98rem; line-height: 1.5; color: var(--portal-muted); }
.pw-cta { min-width: min(100%, 300px); min-height: 50px; margin-top: 6px; border-radius: 14px; font-size: 1rem; font-weight: 650; }
.pw-status { min-height: 1.3em; margin: 0; font-size: .85rem; line-height: 1.45; color: var(--portal-muted); }
.pw-status:empty { display: none; }
.pw-icons + .pw-status { margin-top: 12px; }
.pw-status[data-install-status="error"], .pw-status[data-kind="error"] { color: color-mix(in srgb, var(--portal-danger) 80%, var(--portal-ink)); }
.pw-status[data-install-status="success"], .pw-status[data-kind="success"] { color: color-mix(in srgb, var(--portal-brand) 80%, var(--portal-ink)); }

/* Um pedaço de tela inicial: o ícone escolhido aparece como vai ficar no aparelho. */
.pw-stage { display: grid; place-items: center; width: 100%; max-width: 340px; height: 168px; border: 1px solid var(--portal-border); border-radius: 22px; background:
    radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--portal-brand) 22%, transparent), transparent 60%),
    radial-gradient(110% 90% at 100% 100%, color-mix(in srgb, var(--portal-ink) 10%, transparent), transparent 55%),
    var(--portal-surface-2); }
.pw-stage__app { display: grid; justify-items: center; gap: 8px; }
.pw-stage__app img { display: block; width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 10px 26px rgba(0, 0, 0, .34), 0 0 0 1px color-mix(in srgb, var(--portal-ink) 14%, transparent); }
.pw-stage__app em { font-style: normal; font-size: .82rem; font-weight: 600; color: var(--portal-ink); }

.pw-block { margin-top: 30px; }
.pw-title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 750; line-height: 1.25; color: var(--portal-ink); }
.pw-hint { margin: 0 0 14px; font-size: .9rem; line-height: 1.45; color: var(--portal-muted); }

.pw-icons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pw-icon { position: relative; display: grid; justify-items: start; gap: 12px; padding: 14px; border: 1.5px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); color: var(--portal-ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.pw-icon[aria-checked="true"] { border-color: var(--portal-brand); background: color-mix(in srgb, var(--portal-brand) 8%, var(--portal-surface)); }
.pw-icon:focus-visible, .pw-tab:focus-visible, .pw-faq summary:focus-visible { outline: 2px solid var(--portal-brand); outline-offset: 2px; }
.pw-icon__tile { display: inline-flex; border-radius: 15px; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--portal-ink) 16%, transparent); }
.pw-icon__tile img { display: block; width: 64px; height: 64px; }
.pw-icon__text { display: grid; gap: 2px; }
.pw-icon__text strong { font-size: .98rem; font-weight: 700; }
.pw-icon__text span { font-size: .8rem; line-height: 1.35; color: var(--portal-muted); }
.pw-icon__check { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--portal-border); border-radius: 50%; color: transparent; }
.pw-icon__check svg { width: 14px; height: 14px; }
.pw-icon[aria-checked="true"] .pw-icon__check { border-color: var(--portal-brand); background: var(--portal-brand); color: var(--portal-brand-ink); }

.pw-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin: 12px 0 14px; padding: 3px; border: 1px solid var(--portal-border); border-radius: 12px; background: var(--portal-surface); }
.pw-tab { min-height: 38px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: var(--portal-muted); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.pw-tab[aria-selected="true"] { background: var(--portal-ink); color: var(--portal-bg); }
.pw-guide:focus { outline: none; }
.pw-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pw-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--portal-border); border-radius: 14px; background: var(--portal-surface); }
.pw-steps__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--portal-surface-2); font-size: .85rem; font-weight: 750; color: var(--portal-ink); }
.pw-steps strong { display: block; font-size: .96rem; font-weight: 650; line-height: 1.35; color: var(--portal-ink); }
.pw-steps p { margin: 2px 0 0; font-size: .88rem; line-height: 1.5; color: var(--portal-muted); }
.pw-kbd { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 1px solid var(--portal-border); border-radius: 7px; background: var(--portal-surface-2); font-weight: 600; color: var(--portal-ink); white-space: nowrap; }

.pw-faq { border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); overflow: hidden; }
.pw-faq details + details { border-top: 1px solid var(--portal-border); }
.pw-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 16px; font-size: .94rem; font-weight: 600; line-height: 1.35; color: var(--portal-ink); cursor: pointer; list-style: none; }
.pw-faq summary::-webkit-details-marker { display: none; }
.pw-faq summary svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--portal-muted); transition: transform .2s ease; }
.pw-faq details[open] summary svg { transform: rotate(45deg); }
.pw-faq p { margin: 0; padding: 0 16px 16px; font-size: .9rem; line-height: 1.55; color: var(--portal-muted); }
.pw-open { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 16px; border-radius: 12px; }

@media (max-width: 400px) {
  .pw-icons { gap: 10px; }
  .pw-icon { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pw-icon, .pw-faq summary svg { transition: none; }
}
