:root {
  --primary-blue: #113476;
  --primary-hover: #0c2658;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-dark: #111827;
  --bg-app: #f4f5f7;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --radius-card: 16px;
  --max-w: 420px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #cbd5e1;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.phone {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  background: #ffffff url('assets/fundo.png') center / 100% 100% no-repeat;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
}

/* Faixa de identificação: marca a peça como réplica de estudo, não documento */
.replica-banner {
  position: relative;
  z-index: 5;
  background: #b45309;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-align: center;
  padding: 5px 10px;
  text-transform: uppercase;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 14px;
  position: relative;
  z-index: 2;
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-dne {
  height: 38px;
  max-width: 175px;
  object-fit: contain;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-une {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: #f1f5f9;
}

.icon-btn svg {
  width: 26px;
  height: 26px;
}

/* Conteúdo Principal */
.content {
  position: relative;
  z-index: 2;
  padding: 8px 18px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Card 1: Foto + QR Code lado a lado */
.id-card {
  display: flex;
  padding: 12px;
  gap: 12px;
  align-items: stretch;
  background: #ffffff;
}

.photo-wrap {
  flex: 0 0 43.1%;
  display: flex;
}

.photo-wrap img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: #e2e8f0;
}

.qr-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 4px;
  background: #ffffff;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.qr-wrap:hover {
  background-color: #fafafa;
}

.qr-wrap:active {
  transform: scale(0.98);
}

#qrcode {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
  width: 100%;
}

#qrcode img, #qrcode canvas {
  width: 100% !important;
  max-width: 170px !important;
  height: auto !important;
  display: block;
}

.bilhete-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

.bilhete-num {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
  letter-spacing: 0.2px;
  margin-top: 1px;
}

/* Card 2: Dados do Estudante */
.data-card {
  margin-top: 23px;
  padding: 18px 20px;
}

.data-card .name {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.data-row {
  font-size: 13.5px;
  margin-bottom: 7px;
  color: var(--text-main);
  line-height: 1.4;
}

.data-row:last-child {
  margin-bottom: 0;
}

.data-row .label {
  font-weight: 600;
  color: #374151;
  margin-right: 4px;
}

.data-row .val {
  color: #4b5563;
}

/* Botões de Ação - o laço agora faz parte do fundo geral da tela (.phone),
   então aqui ficam só os botões posicionados sobre ele. */
.actions {
  margin: auto -18px 0;
  padding: 10px 18px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 3;
}

.btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  position: relative;
  z-index: 1;
  transition: transform 0.12s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn-pill {
  width: 60%;
  background: var(--primary-blue);
  color: #ffffff;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(17, 52, 118, 0.28);
}

.btn-pill svg {
  width: 19px;
  height: 19px;
}

.btn-pill:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(17, 52, 118, 0.35);
}

.btn-pill:active {
  transform: translateY(1px);
}

/* ===== TELA DE CERTIFICADO ===== */
.cert-page {
  background: #ffffff;
  min-height: 100vh;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.cert-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #ffffff;
}

.back-btn {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  padding: 4px 0;
}

.back-btn svg {
  width: 22px;
  height: 22px;
}

.cert-inner {
  padding: 10px 20px 36px;
}

/* ===== TELA DE RECARGA ===== */
.recarga-page {
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.recarga-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
  gap: 12px;
}

.recarga-topbar .rec-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: #1f2430;
  min-width: 0;
}

.recarga-topbar .rec-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recarga-topbar .back-plain,
.recarga-topbar .help-plain {
  background: none;
  border: none;
  cursor: pointer;
  color: #1f2430;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  flex-shrink: 0;
}

.recarga-topbar .back-plain svg { width: 24px; height: 24px; }
.recarga-topbar .help-plain svg { width: 24px; height: 24px; }

.recarga-sub {
  padding: 8px 22px 18px;
  font-size: 15.5px;
  color: #3a4150;
  line-height: 1.4;
}

.recarga-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recarga-item {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  background: #e6e6e6;
  border: none;
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.recarga-item:hover { background: #dcdcdc; }
.recarga-item:active { background: #d2d2d2; }

.recarga-item .rec-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #123a8f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recarga-item .rec-ico svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.recarga-item .rec-label {
  font-size: 19px;
  color: #2b303a;
  font-weight: 500;
}

.cert-logo-box {
  margin-bottom: 16px;
}

.meia-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.meia-badge .check-circ {
  width: 38px;
  height: 38px;
}

.meia-txt {
  display: flex;
  flex-direction: column;
}

.meia-txt .t1 {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.2px;
  position: relative;
}

/* Corte horizontal atravessando o wordmark (efeito estêncil do original) */
.meia-txt .t1::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: #ffffff;
  pointer-events: none;
}

.meia-txt .t2 {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.4px;
}

.cert-status-headline {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cert-status-headline .sparkle {
  color: #3b82f6;
  font-size: 14px;
}

.cert-attest-text {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 24px;
}

.cert-attest-text strong {
  color: #0f172a;
  font-weight: 600;
}

.pem-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.pem-card-header {
  background: #2563eb;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.copy-icon-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.copy-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-icon-btn svg {
  width: 18px;
  height: 18px;
}

.pem-card-body {
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.5;
  padding: 14px 16px;
  word-break: break-all;
  color: #334155;
  max-height: 380px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ===== MENU DE 3 BARRAS (ADMINISTRAÇÃO) ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: var(--max-w);
  background: #ffffff;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px 10px;
  background: #ffffff;
}

.drawer-back-btn {
  background: none;
  border: none;
  font-size: 17.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  padding: 4px 0;
}

.drawer-back-btn svg {
  width: 22px;
  height: 22px;
}

.drawer-content {
  padding: 10px 20px 30px;
  display: flex;
  flex-direction: column;
}

.drawer-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 14px 0 8px;
}

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 0;
  border: none;
  background: none;
  color: #374151;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s ease;
}

.drawer-row:hover {
  opacity: 0.8;
}

.drawer-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-row-left svg {
  width: 20px;
  height: 20px;
  color: #475569;
  flex-shrink: 0;
}

.drawer-meta {
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
}

.drawer-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 16px 0 10px;
}

/* Switch Toggle */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e2e8f0;
  transition: 0.2s;
  border-radius: 999px;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background: #2563eb;
}

input:checked + .slider::before {
  transform: translateX(20px);
}

[hidden] {
  display: none !important;
}
