/* ============================================================
   CEA Pay — Base & Reset
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background: var(--color-bg-app);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   Shell do App — Container mobile centralizado
   ============================================================ */
/* Remove outline de foco programático no shell e no conteúdo */
.app-shell:focus,
.app-content:focus {
  outline: none;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--max-width-mobile);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--color-bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
}

/* ============================================================
   Status Bar simulada (aparência iOS)
   ============================================================ */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-4) 6px;
  background: var(--color-statusbar);
  flex-shrink: 0;
}

.status-bar__time {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.status-bar__icons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-bar__icons svg {
  width: 16px;
  height: 16px;
  fill: var(--color-text-primary);
}

/* Ícone de bateria especial */
.status-bar__battery {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-text-primary);
  color: var(--color-text-white);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  border-radius: 4px;
  padding: 2px 5px;
  min-width: 26px;
}

@media (hover: none) and (pointer: coarse) {
  .status-bar {
    display: none;
  }
}

/* ============================================================
   Header do App
   ============================================================ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4) var(--space-3);
  background: var(--color-bg-app);
  flex-shrink: 0;
  gap: var(--space-3);
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.app-header__logo-wrapper {
  display: flex;
  align-items: center;
  height: 38px;
  flex-shrink: 0;
}

.app-header__logo-wrapper img {
  height: 38px;
  width: auto;
  display: block;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.app-header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  transition: background var(--motion-duration-fast) var(--motion-easing);
  color: var(--color-text-primary);
}

.app-header__icon-btn:hover,
.app-header__icon-btn:focus-visible {
  background: var(--color-tap-highlight);
}

.app-header__icon-btn:focus-visible {
  outline: 2px solid var(--color-brand-blue);
  outline-offset: 2px;
}

.app-header__icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   Área de conteúdo rolável
   ============================================================ */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottomnav-height) + var(--safe-area-bottom) + var(--space-4));
  scroll-padding-bottom: var(--bottomnav-height);
}

/* Scrollbar discreta */
.app-content::-webkit-scrollbar {
  width: 3px;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: var(--radius-full);
}

/* ============================================================
   Divisor de Seção
   ============================================================ */
.section-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 0 var(--space-4);
}

.section-divider--full {
  margin: 0;
}

/* ============================================================
   Bottom Navigation
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width-mobile);
  height: calc(var(--bottomnav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--color-bg-bottomnav);
  box-shadow: var(--shadow-bottomnav);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: var(--space-2);
  z-index: 100;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  min-width: 60px;
  min-height: 44px;
  cursor: pointer;
  transition: background var(--motion-duration-fast) var(--motion-easing);
  color: var(--color-text-tertiary);
  text-decoration: none;
}

.bottom-nav__item:hover {
  background: var(--color-bg-pill-active);
  color: var(--color-text-secondary);
}

.bottom-nav__item:focus-visible {
  outline: 2px solid var(--color-brand-blue);
  outline-offset: 2px;
}

/* Estado ativo com pílula cinza ao redor */
.bottom-nav__item--active {
  background: var(--color-bg-pill-active);
  color: var(--color-brand-blue);
}

.bottom-nav__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav__item--active .bottom-nav__icon svg {
  stroke: var(--color-brand-blue);
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* ============================================================
   Typography helpers
   ============================================================ */
.text-blue      { color: var(--color-brand-blue); }
.text-secondary { color: var(--color-text-secondary); }
.text-sm        { font-size: var(--font-size-sm); }
.text-xs        { font-size: var(--font-size-xs); }
.font-semibold  { font-weight: var(--font-weight-semibold); }
.font-bold      { font-weight: var(--font-weight-bold); }
.uppercase      { text-transform: uppercase; letter-spacing: var(--letter-spacing-label); }

/* ============================================================
   Utilitários de layout
   ============================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
