/* Palet: adaçayı yeşil, koyu yeşil, karamel, kehribar. Renkler tek yerde: token'ları değiştirmek tüm siteyi değiştirir. */
:root {
  color-scheme: light;
  --yesil: #6D9773;
  --yesil-koyu: #4F7656;   /* beyaz üstünde okunur yeşil yazı */
  --koyu: #0C3B2E;
  --karamel: #BB8A52;
  --karamel-koyu: #8C5E2A; /* beyaz üstünde okunur karamel yazı */
  --kehribar: #FFBA00;
  --kehribar-acik: #FFF1C7;
  --hardal: #8A6400;       /* kehribar zemin/çerçeve yanında okunur uyarı yazısı */
  --zemin: #E5E8E1;
  --kart: #FFFFFF;
  --alan: #F1F3EE;
  --metin: #0C3B2E;
  --soluk: #6B7A72;
  --cizgi: rgba(12, 59, 46, .14);
  --halka: 0 0 0 3px rgba(255, 186, 0, .45);
  --golge: 0 6px 18px rgba(12, 59, 46, .07);
  --golge-ust: 0 10px 28px rgba(12, 59, 46, .14);
  --r: 18px;
  --font: "Avenir Next", "Avenir", "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--zemin); color: var(--metin);
  font: 16px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: none; box-shadow: var(--halka); }
a { color: var(--yesil-koyu); }
code { font-size: .88em; background: var(--alan); color: var(--koyu); padding: 1px 5px; border-radius: 5px; }
.ik { flex: none; }

/* Üst çubuk */
.ust {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--koyu); color: #fff;
}
.ust .logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.ust .logo svg { width: 28px; height: 28px; flex: none; }
.ust .metin-btn { color: rgba(255, 255, 255, .75); font-weight: 600; font-size: .92rem; border-radius: 8px; }
.ust .metin-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

main { max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 4px 0 14px; font-weight: 700; letter-spacing: -.01em; color: var(--koyu); }
h2 {
  font-size: .74rem; margin: 28px 0 10px; color: var(--soluk);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
}
p { margin: 8px 0; }
ul { padding-left: 20px; margin: 8px 0 14px; }
li { margin: 4px 0; }
.soluk { color: var(--soluk); font-size: .92rem; }

/* Kart */
.kart {
  background: var(--kart); border-radius: var(--r); padding: 16px;
  margin: 10px 0; box-shadow: var(--golge);
}
.kart h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 600; }
a.kart.baglanti {
  display: block; text-decoration: none; color: inherit; position: relative; padding-right: 42px;
  transition: box-shadow .15s, transform .15s;
}
a.kart.baglanti::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--yesil); border-top: 2px solid var(--yesil); transform: rotate(45deg);
}
a.kart.baglanti:hover { box-shadow: var(--golge-ust); }
a.kart.baglanti:active { transform: scale(.995); }

.satir { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Düğmeler */
.btn, button.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 12px 18px; min-height: 50px;
  font: inherit; font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; background: var(--yesil); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--yesil-koyu); }
.btn.ikincil { background: var(--alan); color: var(--koyu); }
.btn.ikincil:hover { background: #E6EAE3; }
.btn.tam { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }
.metin-btn { background: none; border: 0; color: inherit; font: inherit; padding: 8px 10px; cursor: pointer; }

/* Giriş */
input[type=email], input[type=password] {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--alan); color: var(--metin); margin: 6px 0 14px; transition: border-color .15s, box-shadow .15s;
}
input[type=email]:focus, input[type=password]:focus { outline: none; border-color: var(--yesil); box-shadow: var(--halka); }
label { font-weight: 600; font-size: .9rem; }

/* Rozetler */
.rozet {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px;
  font-size: .76rem; font-weight: 700; background: var(--alan); color: var(--koyu);
}
.rozet.uyari { background: var(--kehribar); color: var(--koyu); }
.rozet.tamam { background: var(--yesil); color: #fff; }
.yukleniyor { text-align: center; color: var(--soluk); padding: 48px 0; }

/* Sonuç tablosu */
table.sonuc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
table.sonuc th {
  padding: 0 6px 10px; text-align: right; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--soluk); border-bottom: 1px solid var(--cizgi);
}
table.sonuc td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--cizgi); }
table.sonuc tr:last-child td { border-bottom: 0; background: var(--koyu); color: #fff; }
table.sonuc tr:last-child td:first-child { border-radius: 10px 0 0 10px; }
table.sonuc tr:last-child td:last-child { border-radius: 0 10px 10px 0; }
table.sonuc th:first-child, table.sonuc td:first-child { text-align: left; }
table.sonuc th.d { color: var(--yesil-koyu); } table.sonuc th.y { color: var(--karamel-koyu); } table.sonuc th.b { color: var(--soluk); }
.d { color: var(--yesil-koyu); } .y { color: var(--karamel-koyu); } .b { color: var(--hardal); }

/* Optik kontrol ızgarası */
.bolum {
  margin: 22px 0 6px; padding-bottom: 6px; font-weight: 700; font-size: .92rem;
  border-bottom: 1px solid var(--cizgi);
}
.optik-satir {
  display: grid; grid-template-columns: 34px repeat(5, 1fr); gap: 6px; align-items: center;
  padding: 4px 6px; border-radius: 12px;
}
.optik-satir.kontrol { background: var(--kehribar-acik); box-shadow: inset 0 0 0 1.5px var(--kehribar); }
.optik-satir .no { font-variant-numeric: tabular-nums; color: var(--soluk); text-align: right; font-size: .88rem; font-weight: 600; }
.kab {
  aspect-ratio: 1; max-width: 42px; width: 100%; justify-self: center; border-radius: 50%;
  border: 0; background: var(--kart); color: var(--koyu); box-shadow: 0 2px 6px rgba(12, 59, 46, .08);
  font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; padding: 0;
  transition: background .12s, color .12s;
}
.kab:hover { background: var(--alan); }
.kab.secili { background: var(--koyu); color: #fff; }
.neden-etiket { grid-column: 2 / -1; font-size: .78rem; font-weight: 700; color: var(--hardal); margin-top: -2px; }

/* Neden seçimi */
.soru-kart { border-left: 5px solid var(--koyu); }
.soru-kart.bos { border-left-color: var(--karamel); }
.cipler { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cip {
  border: 0; background: var(--alan); color: var(--koyu); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: .88rem; cursor: pointer; min-height: 40px;
  transition: background .12s, color .12s;
}
.cip:hover { background: #E6EAE3; }
.cip.secili { background: var(--koyu); color: #fff; }
.soru-kart .foto-btn.btn { margin-top: 12px; min-height: 46px; }
.foto-satir { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.foto-satir .metin-btn { color: var(--karamel-koyu); font-weight: 700; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }

/* Köşe seçimi ve önizleme */
.kose-alani { position: relative; touch-action: manipulation; }
.kose-alani canvas { width: 100%; height: auto; border-radius: var(--r); display: block; }
.ilerleme { height: 6px; background: rgba(12, 59, 46, .1); border-radius: 99px; overflow: hidden; margin: 10px 0 16px; }
.ilerleme > div { height: 100%; background: var(--yesil); width: 0; transition: width .25s; border-radius: 99px; }

#bildirim {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--koyu); color: #fff; border-left: 4px solid var(--kehribar);
  padding: 12px 16px; border-radius: 14px; max-width: 92vw; z-index: 20; box-shadow: var(--golge-ust);
  font-weight: 600;
}
.yapiskan-alt {
  position: sticky; bottom: 0; background: linear-gradient(rgba(229, 232, 225, 0), var(--zemin) 35%);
  padding: 20px 0 10px; margin-top: 12px;
}

/* Yazdırma */
.form-sayfa { background: #fff; margin: 16px auto; box-shadow: var(--golge-ust); border-radius: 4px; width: 100%; }
.form-sayfa svg { width: 100%; height: auto; display: block; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; padding: 0; }
  .ust, .yazdirma-yok, #bildirim { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  .form-sayfa { margin: 0; box-shadow: none; border-radius: 0; width: 210mm; height: 297mm; page-break-after: always; }
  .form-sayfa svg { width: 210mm; height: 297mm; }
}
