:root {
  --bg: #f6f1ea;
  --card: #fffdfa;
  --ink: #2a2420;
  --muted: #8a7d70;
  --line: #e8ded2;
  --accent: #b4532a;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6dc;
  --ok: #2f7a4f;
  --warn: #a8670d;
  --warn-soft: #fbf0dc;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
}
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 140px; }

.hero { padding: 26px 2px 18px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { font: 600 clamp(28px, 6vw, 38px)/1.12 var(--serif); margin: 0 0 12px; letter-spacing: -.01em; text-wrap: balance; }
.lede { margin: 0; color: #5d5148; }
h2 { font: 600 19px/1.3 var(--serif); margin: 0; display: flex; align-items: center; gap: 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 1px 0 rgba(60, 40, 20, .03);
}
.card.center { text-align: center; padding: 34px 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 600 13px/1 var(--sans);
}
.muted { color: var(--muted); font-size: 14px; }
.tip { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* Dosya seçme alanı */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1.5px dashed #d6c6b5; border-radius: 12px; padding: 22px 12px;
  color: var(--accent); cursor: pointer; text-align: center; background: #fdf8f3;
  transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: var(--accent-soft); border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-title { font-weight: 600; color: var(--ink); margin-top: 4px; }
.drop-sub { font-size: 13px; color: var(--muted); }

/* Fotoğraf ızgarası */
.grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ph { position: relative; display: flex; flex-direction: column; gap: 8px; }
.ph-frame {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: #efe6db; display: grid; place-items: center;
}
.ph-frame .paper {
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); overflow: hidden; display: block;
}
.ph-frame .paper.land { width: 88%; aspect-ratio: 3 / 2; }
.ph-frame .paper.port { height: 88%; aspect-ratio: 2 / 3; }
.ph-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-remove {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(30, 22, 16, .62); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.ph-remove:hover { background: rgba(30, 22, 16, .85); }
.badge {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 99px;
  background: var(--warn-soft); color: var(--warn);
}
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.good { background: #e3f2e8; color: var(--ok); }

.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; height: 36px; border: 0; background: transparent; font-size: 20px; color: var(--accent); cursor: pointer; }
.stepper button:disabled { color: #d0c4b8; cursor: default; }
.stepper button:hover:not(:disabled) { background: var(--accent-soft); }
.stepper output { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
.stepper output small { font-weight: 400; color: var(--muted); }

/* Form alanları */
.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field textarea {
  width: 100%; font: inherit; color: inherit; padding: 12px 13px; border-radius: 10px;
  border: 1px solid #ddd0c2; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid { border-color: var(--danger); }

.error { background: var(--danger-soft); color: var(--danger); padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 14px 0; }
.notice { background: var(--warn-soft); color: #6f4708; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 14px; }

/* Alt özet çubuğu */
.summary {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 720px) / 2 + 16px)) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 250, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.summary-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.summary-text span { font-size: 13px; color: var(--muted); }
.summary-text b { font-size: 19px; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--sans); padding: 14px 20px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: #9c4520; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #d9c9ba; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 9px 12px; font-size: 14px; border-radius: 9px; }

.bar { height: 10px; background: #efe6db; border-radius: 99px; overflow: hidden; margin: 18px auto 0; max-width: 360px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .25s; }

.done .check { width: 64px; height: 64px; border-radius: 50%; background: #e3f2e8; color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.done p { color: #5d5148; margin: 8px 0 22px; }

/* Durum sayfası */
.status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: #e3f2e8; color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.timeline { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 0 0 14px; position: relative; color: var(--muted); }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d6c6b5; background: var(--card); margin: 5px 0 0 3px; z-index: 1; }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.current { color: var(--ink); font-weight: 600; }
.timeline li.current::before { border-color: var(--accent); background: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.reason { font-size: 13px; color: var(--danger); margin: 0; }
.ph-actions { display: flex; gap: 6px; }
.ph-actions .btn { flex: 1; }
.ph.rejected .ph-frame { outline: 2px solid var(--danger); outline-offset: -2px; }

@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .btn { padding: 13px 14px; }
}
