/* POI Service — Mobile-first minimal CSS */
:root {
  --primary: #4a6cf7;
  --primary-light: #e8edff;
  --accent: #f97316;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-card: #f9fafb;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

header .logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  text-decoration: none;
}

.lang-switch {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.lang-switch a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* ── Sections (step flow) ───────────────────────── */
.step { display: none; }
.step.active { display: block; }

/* ── Landing ────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Upload ─────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin: 24px 0;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone .hint { color: var(--text-muted); font-size: 14px; }
.upload-zone .supported { color: var(--text-muted); font-size: 12px; margin-top: 8px; }

.upload-zone.file-selected {
  border-color: var(--success);
  background: #f0fdf4;
}

.upload-zone.file-selected .hint {
  color: var(--text);
  font-weight: 600;
}

.upload-zone input[type="file"] { display: none; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0;
  font-size: 14px;
}

.checkbox-row input { margin-top: 4px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) { background: #3b5de7; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.btn-group .btn { flex: 1; }

/* ── Progress ───────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 24px 0;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

/* ── Profile badge ──────────────────────────────── */
.profile-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
  margin: 8px 0;
}

/* ── Quadrant chart ─────────────────────────────── */
.quadrant-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 16px auto;
  aspect-ratio: 1;
}

.quadrant-wrapper canvas {
  width: 100%;
  height: 100%;
}

/* ── Metric rows ────────────────────────────────── */
.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.metric-row:last-child { border-bottom: none; }

.metric-label {
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
}

.metric-value {
  font-weight: 600;
  font-size: 16px;
  min-width: 60px;
  text-align: right;
}

.metric-bar {
  flex: 1;
  max-width: 120px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 0 12px;
  overflow: hidden;
}

.metric-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.metric-rel {
  font-size: 13px;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.metric-rel-up { color: var(--success); }
.metric-rel-down { color: var(--error); }
.metric-rel-neutral { color: var(--text-muted); }

/* ── AI Chat ────────────────────────────────────── */
.ai-chat {
  margin: 16px 0;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.5;
  max-width: 90%;
}

.chat-bubble.ai {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

/* ── AI Thinking indicator ─────────────────────── */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  margin: 8px 0;
  max-width: 90%;
}

.ai-thinking-dots {
  display: flex;
  gap: 4px;
}

.ai-thinking-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.ai-thinking-text {
  font-size: 13px;
  color: var(--text-muted);
  animation: thinking-fade 2s ease-in-out infinite;
}

@keyframes thinking-fade {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── Chat input area (stacked layout) ──────────── */
.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.chat-input-area textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  line-height: 1.5;
}

.chat-input-area textarea:focus { border-color: var(--primary); }

.chat-input-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.chat-input-actions .btn {
  width: auto;
  padding: 10px 24px;
}

/* Legacy chat-input (row layout for inline small inputs) */
.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}

.chat-input textarea,
.chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.chat-input textarea {
  min-height: 60px;
  max-height: 200px;
}

.chat-input textarea:focus,
.chat-input input:focus { border-color: var(--primary); }

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.option-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.option-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.option-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ── Slider ─────────────────────────────────────── */
.slider-group {
  margin: 20px 0;
}

.slider-group label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.slider-value {
  text-align: center;
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  margin: 8px 0;
}

/* ── Radio group ────────────────────────────────── */
.radio-group {
  margin: 16px 0;
}

.radio-group label {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 6px 0;
  cursor: pointer;
  transition: border-color 0.2s;
}

.radio-option:hover { border-color: var(--primary); }
.radio-option input { accent-color: var(--primary); }

/* ── Consent ────────────────────────────────────── */
.consent-option {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  cursor: pointer;
  transition: border-color 0.2s;
}

.consent-option:hover { border-color: var(--primary); }
.consent-option.selected { border-color: var(--primary); background: var(--primary-light); }

.consent-option h4 { font-size: 15px; margin-bottom: 4px; }
.consent-option p { font-size: 13px; color: var(--text-muted); }

/* ── Final screen ───────────────────────────────── */
.final-screen {
  text-align: center;
  padding: 40px 0;
}

.final-screen h2 { margin-bottom: 8px; }

.research-id-box {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 18px;
  margin: 16px 0;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}

.action-card:hover { border-color: var(--primary); }
.action-card .action-icon { font-size: 24px; }
.action-card .action-text h4 { font-size: 15px; }
.action-card .action-text p { font-size: 13px; color: var(--text-muted); }

/* ── Privacy notice ─────────────────────────────── */
.privacy-notice h3 {
  font-size: 16px;
  color: var(--primary);
}

.privacy-notice p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

.privacy-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  color: var(--text);
  margin: 8px 0;
  line-height: 1.5;
}

.privacy-list li::before {
  content: "🔒";
  position: absolute;
  left: 0;
  font-size: 13px;
}

/* ── Export guide ───────────────────────────────── */
.export-guide {
  margin: 16px 0;
}

.export-guide details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.export-guide summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
}

.export-guide ol {
  margin: 12px 0 0 20px;
  font-size: 14px;
}

.export-guide ol li { margin: 6px 0; }

.export-guide .warning {
  color: var(--accent);
  font-size: 13px;
  margin-top: 8px;
}

/* ── Error ──────────────────────────────────────── */
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin: 16px 0;
  display: none;
}

.error-msg.visible { display: block; }

/* ── Confirmation step ─────────────────────────── */
.confirm-grid {
  margin: 16px 0;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.confirm-row:last-child { border-bottom: none; }

.confirm-label {
  color: var(--text-muted);
  font-size: 14px;
}

.confirm-value {
  font-weight: 600;
  font-size: 15px;
}

/* ── Category selector on confirm step ─────────── */
.category-select {
  margin-top: 16px;
}

.category-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Responsive ─────────────────────────────────── */
@media (min-width: 768px) {
  .container { padding: 24px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 18px; }
}
