/* psikopulse — Sağlık çalışanı psikososyal yük anketi */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-primary: #0d7377;
  --c-primary-dark: #0a5d60;
  --c-primary-light: #e0f2f3;
  --c-secondary: #14a09a;
  --c-bg: #f8fafb;
  --c-card: #ffffff;
  --c-text: #1a2730;
  --c-text-muted: #6b7c85;
  --c-border: #e1e8eb;
  --c-warning: #d97706;
  --c-warning-bg: #fef3c7;
  --c-success: #059669;
  --c-danger: #dc2626;

  --c-low: #10b981;     /* yeşil = düşük tükenmişlik / yüksek iyilik */
  --c-mid: #f59e0b;     /* turuncu = orta */
  --c-high: #dc2626;    /* kırmızı = yüksek tükenmişlik / düşük iyilik */

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ----- TopBar ----- */
.topbar {
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.85);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15em; }
.logo-mark {
  width: 28px; height: 28px;
  color: var(--c-primary);
  flex-shrink: 0;
  display: block;
}
.logo-text { color: var(--c-primary); letter-spacing: -0.02em; }
.topbar-info { display: flex; gap: 12px; flex-wrap: wrap; }
.anket-info {
  font-size: 0.78em; color: var(--c-text-muted);
  background: var(--c-primary-light); padding: 3px 8px; border-radius: 6px;
}
@media (max-width: 480px) { .topbar-info .anket-info:nth-child(2) { display: none; } }

/* ----- Main + Steps ----- */
.main { padding: 24px 0 80px; }
.step {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
}
.hidden { display: none !important; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header { margin-bottom: 20px; }
.step-num {
  display: inline-block; background: var(--c-primary); color: white;
  padding: 3px 10px; border-radius: 20px; font-size: 0.78em; font-weight: 600;
  margin-bottom: 10px;
}
h1 { font-size: 1.7em; line-height: 1.25; margin-bottom: 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.4em; line-height: 1.3; }
h3 { font-size: 1.1em; margin: 24px 0 12px; }
.lead { color: var(--c-text-muted); margin-bottom: 24px; font-size: 1.02em; }
.muted { color: var(--c-text-muted); font-size: 0.92em; margin-top: 4px; }
.muted-small { color: var(--c-text-muted); font-size: 0.85em; }

/* ----- Welcome screen ----- */
.info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin: 20px 0;
}
@media (max-width: 480px) { .info-grid { grid-template-columns: repeat(2, 1fr); } }

.info-card {
  background: var(--c-primary-light);
  padding: 18px 10px 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.92em;
  border: 1px solid rgba(13, 115, 119, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.info-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13, 115, 119, 0.10); }
.info-card strong { display: block; font-size: 1em; color: var(--c-primary-dark); }
.info-card small { color: var(--c-text-muted); font-size: 0.82em; }
.info-icon {
  width: 30px; height: 30px;
  color: var(--c-primary);
  display: block;
  margin: 0 auto 8px;
  stroke-width: 1.8;
}

/* Details boxes */
.details-box {
  margin: 16px 0;
  padding: 12px 16px;
  background: #f5f7f8;
  border-radius: 10px;
  border-left: 3px solid var(--c-primary);
}
.details-box summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--c-primary-dark);
  user-select: none;
}
.details-box[open] summary { margin-bottom: 10px; }
.details-box p, .details-box ul { font-size: 0.92em; color: var(--c-text); margin-bottom: 8px; }
.details-box ul { padding-left: 20px; }
.details-box li { margin-bottom: 4px; }
.details-box em { color: var(--c-primary-dark); font-style: normal; font-weight: 500; }
.details-box a { color: var(--c-primary); }
.warning-text { color: var(--c-warning) !important; font-weight: 500; }

/* Warning box */
.warning-box {
  background: var(--c-warning-bg);
  border-left: 4px solid var(--c-warning);
  padding: 14px 16px;
  border-radius: 8px;
  margin-top: 20px;
}
.warning-box p { margin-top: 6px; font-size: 0.95em; }
.warning-box small { display: block; margin-top: 8px; color: var(--c-text-muted); }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-align: center;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--c-primary); color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--c-primary-dark); }
.btn-lg { padding: 14px 32px; font-size: 1.05em; margin-top: 16px; }
.btn-ghost {
  background: transparent; color: var(--c-text-muted);
}
.btn-ghost:hover { color: var(--c-text); background: #f0f3f4; }
.btn-secondary {
  background: white; color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.btn-secondary:hover { background: var(--c-primary-light); }
.btn-block { display: block; width: 100%; margin-top: 10px; }

.step-nav {
  display: flex; justify-content: space-between;
  margin-top: 24px; gap: 12px;
}
.step-nav .btn-primary { margin-left: auto; }

/* ----- Form / Search inputs ----- */
.form-group { margin-bottom: 16px; }
.search-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1em;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--c-primary); }

.option-list {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: white;
}
.option-list.grid-2 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  max-height: none; padding: 6px; border: none; background: transparent;
}
@media (max-width: 480px) { .option-list.grid-2 { grid-template-columns: 1fr; } }

.option-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-border);
  transition: background 0.1s;
  font-size: 0.95em;
  line-height: 1.35;
}
.option-list.grid-2 .option-item {
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  background: white;
  text-align: center;
  padding: 14px 12px;
  font-size: 0.9em;
}
.option-item:last-child { border-bottom: none; }
.option-item:hover { background: var(--c-primary-light); }
.option-item.empty { color: var(--c-text-muted); cursor: default; padding: 20px; text-align: center; }
.option-item.empty:hover { background: white; }
.option-item-meta { font-size: 0.8em; color: var(--c-text-muted); margin-top: 2px; }

/* ----- Anket ----- */
.progress-bar {
  height: 6px;
  background: #e1e8eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  width: 0%;
  transition: width 0.3s;
}

.question {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border);
}
.question:last-child { border-bottom: none; }
.question-text {
  font-size: 1.02em;
  margin-bottom: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.answer-options {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.answer-option {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 10px 8px;
  border: 1.5px solid var(--c-border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
  line-height: 1.25;
}
.answer-option:hover { border-color: var(--c-primary); }
.answer-option.selected {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: white;
}
@media (max-width: 480px) {
  .answer-options { flex-direction: column; }
  .answer-option { width: 100%; min-width: 0; }
}

/* ----- Sonuç ----- */
.result-overall {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 24px 0;
}
@media (max-width: 480px) { .result-overall { grid-template-columns: 1fr; } }

.result-card {
  background: linear-gradient(135deg, var(--c-primary-light), white);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--c-border);
}
.result-label { font-size: 0.85em; color: var(--c-text-muted); margin-bottom: 6px; }
.result-score { font-size: 2.4em; font-weight: 700; color: var(--c-primary-dark); line-height: 1; }
.result-band { font-size: 0.85em; margin-top: 6px; font-weight: 500; }
.band-dusuk { color: var(--c-low); }
.band-orta_dusuk, .band-orta { color: var(--c-mid); }
.band-yuksek { color: var(--c-high); }

.result-comment {
  background: var(--c-primary-light);
  padding: 16px 18px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 1em;
  border-left: 3px solid var(--c-primary);
}

.scale-result {
  background: white;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.scale-result-label { flex: 1; font-size: 0.95em; font-weight: 500; }
.scale-result-meta { font-size: 0.82em; color: var(--c-text-muted); }
.scale-result-score {
  font-size: 1.6em; font-weight: 700; min-width: 60px; text-align: right;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 700px) { .comparison-grid { grid-template-columns: 1fr; } }

.comparison-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 14px;
}
.comparison-muted {
  background: #f5f7f8;
  color: var(--c-text-muted);
}
.comparison-title {
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 2px;
}
.comparison-note {
  color: var(--c-text-muted);
  font-size: 0.82em;
  margin-bottom: 10px;
}
.comparison-help {
  font-size: 0.86em;
  line-height: 1.4;
}
.comparison-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--c-border);
}
.comparison-row span { font-size: 0.86em; color: var(--c-text-muted); }
.comparison-row strong { font-size: 1.15em; color: var(--c-text); }
.comparison-row small {
  grid-column: 1 / -1;
  color: var(--c-text-muted);
  font-size: 0.78em;
}

.turnstile-container {
  display: flex;
  justify-content: center;
  min-height: 0;
}
.turnstile-container:empty { display: none; }

/* ----- Footer ----- */
.footer {
  background: #1a2730;
  color: #c8d4d8;
  padding: 32px 0;
  margin-top: 60px;
}
.footer .container {
  display: grid; grid-template-columns: 1fr 1.6fr;
  gap: 36px;
}
@media (max-width: 700px) { .footer .container { grid-template-columns: 1fr; gap: 24px; } }
.footer-section strong { color: white; display: block; margin-bottom: 8px; }
.footer-section a { color: #5fb8b3; }
.footer .muted-small { color: #8ea0a8; font-size: 0.82em; }
