:root {
  --gov-blue: #1351b4;
  --gov-blue-dark: #0c326f;
  --gov-blue-light: #155bcb;
  --app-accent: #1e4f86;
  --app-toolbar-bg: #f3f3f5;
  --app-nav-bg: #f3f3f5;
  --app-surface: #ffffff;
  --app-page-bg: #f2f2f2;
  --app-text: #17191d;
  --app-text-secondary: #5b6068;
  --app-border: #d9d9df;
  --app-border-light: #d4d4d8;
  --surface: #ffffff;
  --page-bg: #f2f2f2;
  --text: #333333;
  --muted: #636363;
  --border: #e3e3e3;
  --border-strong: #cccccc;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-topbar: 0 1px 0 rgba(0, 0, 0, 0.06);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 56px;
  --tabs-h: 48px;
  --bottom-nav-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--app-page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-rg-view {
  background: var(--app-toolbar-bg);
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html:has(body.is-rg-view) {
  overflow: hidden;
  overscroll-behavior: none;
}

body.is-rg-view .app {
  position: fixed;
  inset: 0;
  height: auto;
  min-height: 0;
  overflow: clip;
}

body.is-servicos-view,
body.is-opcoes-view {
  background: var(--app-surface);
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loading-screen--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__inner {
  animation: loading-screen-breathe 1.6s ease-in-out infinite;
}

.loading-screen__logo {
  display: block;
  max-width: min(36vw, 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

@keyframes loading-screen-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.88;
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-screen__inner {
    animation: none;
  }
}

.app {
  position: relative;
  max-width: min(960px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

.app:has(#viewRg:not([hidden])) {
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

.page-title {
  margin: 0.35rem 0 1.1rem;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--app-text);
  text-align: center;
  letter-spacing: -0.01em;
}

.rg-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#viewRg {
  --rg-toolbar-inset: 0.75rem;
  --rg-img-gap: 0.45rem;
  margin: 0;
  padding: 0;
}

#viewRg:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  margin-bottom: 0;
  min-height: 0;
}

#viewRg .doc-slider-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  touch-action: none;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 0.2rem 0 0.1rem;
  box-sizing: border-box;
  background: var(--app-toolbar-bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#viewRg.is-qr-tab .doc-slider-viewport {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 0;
  padding: 1rem 0 0.25rem;
  overflow: hidden;
}

#viewRg.is-qr-tab .tab-panels {
  flex: 1 1 auto;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

#viewRg.is-qr-tab #panelFrente,
#viewRg.is-qr-tab #panelVerso {
  height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
}

#viewRg.is-qr-tab .tab-panel {
  justify-content: flex-start;
}

#viewRg.is-qr-tab #panelQr {
  padding: 0 1.1rem;
  justify-content: flex-start;
  align-items: center;
  visibility: visible;
  height: 100%;
  min-height: 0;
}

#viewRg .tab-panels {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  width: 400%;
  transition: transform 320ms ease;
  will-change: transform;
  transform: translateX(0%);
  flex: 1 1 auto;
  min-height: 0;
  align-self: stretch;
  height: auto;
}

#viewRg .tab-panel {
  flex: 0 0 25%;
  min-width: 25%;
  min-height: 0;
  height: 100%;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#viewRg #panelFrente,
#viewRg #panelVerso {
  padding: 0;
}

#viewRg #panelFrente .rg-frame,
#viewRg #panelVerso .rg-frame {
  position: relative;
  padding: var(--rg-img-gap) 0;
}

#viewRg #panelFrente .rg-frame__img,
#viewRg #panelVerso .rg-frame__img {
  position: absolute;
  top: var(--rg-img-gap);
  bottom: var(--rg-img-gap);
  left: 0;
  width: 100%;
  height: calc(100% - 2 * var(--rg-img-gap));
  max-height: none;
  margin: 0;
  object-fit: contain;
}

#viewRg #panelQr {
  justify-content: flex-start;
}

#viewRg .rg-toolbar {
  border: none;
  border-radius: 0;
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: none;
  background: var(--app-toolbar-bg);
  flex-shrink: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 0.6rem);
  padding-bottom: 0.25rem;
}

#viewRg .topbar__row--title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0 var(--rg-toolbar-inset);
  border-bottom: none;
  background: transparent;
}

#viewRg .topbar__row--title .topbar__back {
  grid-column: 1;
  justify-self: start;
  margin: 0;
}

#viewRg .topbar__row--title .topbar__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  margin: 0;
  gap: 0;
}

#viewRg .topbar__back,
#viewRg .topbar__iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #222222;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

#viewRg .topbar__back:active,
#viewRg .topbar__iconbtn:active {
  background: rgba(0, 0, 0, 0.06);
}

#viewRg .topbar__back:hover,
#viewRg .topbar__back:focus-visible,
#viewRg .topbar__iconbtn:hover,
#viewRg .topbar__iconbtn:focus-visible {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

#viewRg .topbar__icon-svg {
  width: 24px;
  height: 24px;
  display: block;
  pointer-events: none;
}

#viewRg .topbar__icon-svg--back {
  margin-left: 0;
}

#viewRg .topbar__row--title .topbar__heading {
  position: static;
  grid-column: 2;
  transform: none;
  left: auto;
  margin: 0;
  max-width: none;
  width: auto;
  padding: 0 0.35rem;
  font-size: 1.18rem;
  font-weight: 400;
  color: var(--app-text);
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
}

#viewRg .doc-tabs {
  background: var(--app-toolbar-bg);
}

#viewRg .doc-tabs__tab {
  font-size: 1rem;
  padding: 0.78rem 0.35rem 0.7rem;
  font-weight: 600;
  color: #5d6169;
  border-bottom-width: 3px;
}

#viewRg .doc-tabs__tab[aria-selected="true"] {
  color: var(--app-text);
  border-bottom-color: #17191d;
}

.topbar__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.35rem 0 0.1rem;
  min-height: var(--topbar-h);
  justify-content: flex-start;
}

.topbar__row--title {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--topbar-h);
  padding: 0 0.35rem;
}

.topbar__row--title .topbar__heading {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: calc(100% - 180px);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1f1f24;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.topbar__row--title .topbar__back {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.topbar__row--title .topbar__actions {
  position: relative;
  z-index: 1;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar__iconbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1f1f24;
  cursor: pointer;
}

.topbar__iconbtn:hover,
.topbar__iconbtn:focus-visible {
  background: rgba(19, 81, 180, 0.08);
  outline: none;
}

.topbar__icon-svg {
  display: block;
  pointer-events: none;
}

.topbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1f1f24;
  cursor: pointer;
}

.topbar__back:hover,
.topbar__back:focus-visible {
  background: rgba(19, 81, 180, 0.08);
  outline: none;
}

.topbar__back-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(2px, -2px);
}

.main {
  flex: 1;
  padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem 1.5rem;
}

.main:has(#viewRg:not([hidden])) {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.main:has(#viewRg:not([hidden])) #sectionCarteira {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main:has(#viewServicos:not([hidden])),
.main:has(#viewOpcoes:not([hidden])) {
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
  background: var(--app-surface);
}

.main--bottom-nav {
  padding-bottom: 0.25rem;
}

.view--static {
  padding-top: 0.15rem;
}

.page-title--static {
  margin: 0.35rem 0 0.95rem;
  color: var(--app-text);
  font-size: 1.28rem;
}

.static-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.static-list__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.68rem 0.1rem;
  border-bottom: 1px solid #d7d7da;
}

.static-list__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e9e9eb;
  color: #254f7c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.static-list__text {
  font-size: 1rem;
  font-weight: 700;
  color: #1c1f25;
  line-height: 1.2;
}

.static-list__chevron {
  margin-left: auto;
  color: #22242a;
  font-size: 2rem;
  line-height: 1;
}

.static-version {
  margin-top: 0;
  padding: 0.65rem 0.1rem 0.2rem;
  border-top: 1px solid #d7d7da;
  color: #353941;
}

.static-version p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
}

.static-version p + p {
  margin-top: 0.15rem;
}

.static-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.profiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.profiles > li {
  width: 100%;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin: 0;
  min-height: 118px;
  padding: 1rem 0.95rem;
  font-family: inherit;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.profile-card:hover,
.profile-card:focus-visible {
  border-color: #c8ccd4;
  background: #fafafa;
  outline: none;
}

.profile-card:active {
  background: #f5f5f6;
}

.profile-card__left {
  flex: 0 0 auto;
}

.profile-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ebebee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-card__flag-img {
  width: 42px;
  height: 30px;
  object-fit: cover;
  border-radius: 2px;
}

.profile-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.profile-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c3138;
  letter-spacing: 0.01em;
}

.profile-card__name {
  font-size: 1.28rem;
  font-weight: 700;
  color: #17191d;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.profile-card__number {
  margin-top: 0.28rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--app-text-secondary);
}

.profile-card__number--cpf {
  margin-top: 0.1rem;
}

.profile-card__chevron {
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 2.35rem;
  line-height: 1;
  color: #62666e;
  flex: 0 0 auto;
}

.doc-tabs {
  position: static;
  display: flex;
  flex-direction: row;
  margin: 0;
  padding: 0;
  background: var(--app-toolbar-bg);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.doc-tabs__tab {
  flex: 1;
  margin: 0;
  padding: 0.82rem 0.35rem 0.74rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5d6169;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.doc-tabs__tab:hover,
.doc-tabs__tab:focus-visible {
  color: var(--gov-blue);
  outline: none;
}

.doc-tabs__tab[aria-selected="true"] {
  color: var(--gov-blue);
  border-bottom-color: var(--gov-blue);
  background: transparent;
}

.rg-toolbar .doc-tabs--below {
  margin-top: 0;
}

.tab-panels {
  margin-top: 0.75rem;
}

.tab-panel[hidden] {
  display: none !important;
}

.rg-frame {
  position: relative;
  min-height: 220px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.rg-frame__img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(72vh, 520px);
  object-fit: contain;
  object-position: center;
}

#viewRg .rg-frame__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
}

#viewRg .rg-frame {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: var(--rg-img-gap);
  background: transparent;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rg-frame__placeholder {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 1.25rem;
  line-height: 1.45;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95rem;
  padding: 0.35rem 0 0.5rem;
  width: 100%;
}

#viewRg.is-qr-tab .qr-panel {
  justify-content: flex-start;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 0;
}

#viewRg.is-qr-tab .qr-panel__card {
  width: min(100%, 340px);
  padding: 0.85rem 0.85rem 0.7rem;
}

#viewRg.is-qr-tab .qr-panel__img {
  width: 100%;
  max-width: min(300px, calc(100dvh - 420px));
}

#viewRg.is-qr-tab .qr-panel__tip {
  width: min(100%, 340px);
  padding: 0.75rem 0.85rem;
}

#viewRg.is-qr-tab .footer--rg {
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  margin-top: 0;
  padding: 0.5rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-panel__card {
  width: min(100%, 420px);
  background: #f6f6f7;
  border: 1px solid #dddddf;
  border-radius: 14px;
  padding: 0.95rem 0.95rem 0.75rem;
  box-shadow: none;
}

.qr-panel__img {
  display: block;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  height: auto;
  border-radius: 6px;
}

.qr-panel__timer {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
  font-weight: 500;
  color: #54575f;
  letter-spacing: 0.04em;
}

.qr-panel__progress-track {
  margin: 0.72rem auto 0;
  width: min(88%, 360px);
  height: 5px;
  border-radius: 999px;
  background: #d8d2ef;
  overflow: hidden;
}

.qr-panel__progress-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #1e4f86;
  transition: width 220ms linear;
}

.qr-panel__tip {
  width: min(94vw, 560px);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border: 2px solid #2d7cf6;
  border-radius: 14px;
  background: #dbe7f6;
  padding: 0.9rem 1rem;
}

.qr-panel__tip-icon {
  line-height: 0;
  color: #1a63cc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-panel__tip-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.22;
  color: #0f3f7a;
  font-weight: 700;
}

.info-panel {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0.5rem 0.6rem;
}

.info-panel__card {
  margin: 0;
  background: var(--surface);
  border: 1px solid #dddddf;
  border-radius: 14px;
  padding: 0.25rem 1rem;
}

.info-panel__row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e6e6e9;
}

.info-panel__row:last-child {
  border-bottom: none;
}

.info-panel__row dt {
  font-size: 0.85rem;
  color: var(--app-text-secondary);
}

.info-panel__row dd {
  margin: 0.15rem 0 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--app-text);
  word-break: break-word;
}

.footer {
  margin-top: -0.35rem;
  padding: 0.45rem 1.25rem 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.footer--rg {
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  margin: 0;
  padding: 0.5rem 1rem 0.5rem;
  background: var(--app-toolbar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer--rg[hidden] {
  display: none !important;
}

#viewRg #footerStatus {
  margin: 0;
  font-weight: 600;
  color: #3a3d43;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 200;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-around;
  min-height: var(--bottom-nav-h);
  padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--app-nav-bg);
  border-top: 1px solid var(--app-border);
  box-shadow: none;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  max-width: 120px;
  margin: 0;
  padding: 0.35rem 0.45rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8c9098;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.bottom-nav__item:hover,
.bottom-nav__item:focus-visible {
  color: var(--app-accent);
  outline: none;
}

.bottom-nav__item--active {
  color: var(--app-accent);
}

.bottom-nav__item--active .bottom-nav__icon {
  color: var(--app-accent);
}

.bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  width: 1.45rem;
  height: 1.45rem;
  transition: color 0.15s;
}

.bottom-nav__label {
  line-height: 1.15;
  text-align: center;
}
