:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-dark: #0058b0;
  --danger: #d70015;
  --success: #1a7f37;
  --border: #d2d2d7;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #98989d;
    --border: #3a3a3c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 8px 0 28px;
}
.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin: 0;
}
.settings-link {
  position: absolute;
  right: 0;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.settings-link:hover { color: var(--accent); }

.screen { display: none; }
.screen.active { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.capture-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.capture-box:hover { border-color: var(--accent); }
.capture-icon {
  font-size: 40px;
  line-height: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.capture-text { color: var(--muted); font-size: 15px; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 80px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.preview-image {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--card);
}

#verify-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#verify-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
#verify-form input,
#verify-form select {
  font-size: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
#verify-form input:focus,
#verify-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  text-align: center;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }

.success-icon, .error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  margin-top: 40px;
}
.success-icon { background: var(--success); }
.error-icon { background: var(--danger); }

#screen-success, #screen-error { text-align: center; }
#success-fileLink { width: 100%; }
