:root {
  --teal: #00D4B8;
  --blue: #0066FF;
  --green: #00E676;
  --bg: #050C18;
  --bg-card: #0d1826;
  --text: #f2f6fa;
  --text-dim: #9fb0c3;
  --danger: #ff5470;
  --radius: 16px;
  --brand-color: var(--teal);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}
.brand-header img { height: 56px; object-fit: contain; }
.brand-header h1 { font-size: 20px; margin: 0; text-align: center; }

h2 { font-size: 22px; margin: 0 0 8px; }
p.subtitle { color: var(--text-dim); margin: 0 0 24px; font-size: 15px; line-height: 1.4; }

label {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

input[type="email"],
input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  border-radius: var(--radius);
  border: 1px solid #1e2d40;
  background: var(--bg-card);
  color: var(--text);
  margin-bottom: 16px;
  -webkit-appearance: none;
}
input:focus { outline: 2px solid var(--brand-color); }

.btn {
  display: block;
  width: 100%;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  background: var(--brand-color);
  color: #04121a;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
  min-height: 56px; /* alvo de toque grande pro mobile */
}
.btn:active { opacity: 0.8; }
.btn.secondary { background: transparent; border: 1px solid var(--brand-color); color: var(--brand-color); }
.btn.ghost { background: transparent; color: var(--text-dim); font-weight: 400; }
.btn:disabled { opacity: 0.5; }

.link-row { text-align: center; margin-top: 8px; }
.link-row a { color: var(--brand-color); text-decoration: none; font-size: 15px; }

.error-msg {
  background: rgba(255, 84, 112, 0.12);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.success-msg {
  background: rgba(0, 230, 118, 0.12);
  color: var(--green);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}

.card-list { display: flex; flex-direction: column; gap: 12px; }
.card-option {
  background: var(--bg-card);
  border: 1px solid #1e2d40;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.card-option:active { border-color: var(--brand-color); }
.card-option .info { flex: 1; }
.card-option .info .name { font-size: 17px; font-weight: 600; }
.card-option .info .meta { font-size: 13px; color: var(--text-dim); }

.consent-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
  max-height: 40vh;
  overflow-y: auto;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.checkbox-row input { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.checkbox-row span { font-size: 14px; line-height: 1.4; }

.camera-box {
  width: 100%;
  aspect-ratio: 3/4;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}
.camera-box video, .camera-box img { width: 100%; height: 100%; object-fit: cover; }
.camera-box video.mirrored { transform: scaleX(-1); } /* selfie espelhada, como um espelho de verdade */
.flash-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  mix-blend-mode: screen; /* ilumina sem cobrir totalmente o preview */
}
.camera-box .face-guide {
  position: absolute;
  inset: 15%;
  border: 3px dashed var(--brand-color);
  border-radius: 50%;
  pointer-events: none;
}

.tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.tab.active { background: var(--brand-color); color: #04121a; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 90px;
}
.photo-grid .photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
}
.photo-grid .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .photo .fav-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.bottom-bar .btn { margin-bottom: 0; }

.empty-state { text-align: center; color: var(--text-dim); padding: 60px 20px; font-size: 15px; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--brand-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-loading { display: flex; align-items: center; justify-content: center; flex: 1; }

.pin-input {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.pin-input input {
  width: 44px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  padding: 0;
  margin-bottom: 0;
}
