/* =============================================================
   MUHARREM BİLEN KUAFÖR — Online Randevu
   Mobil öncelikli, sade, premium berber hissi: beyaz zemin, siyah aksiyon.
   ============================================================= */

:root {
  --bg: #f6f6f7; --surface: #ffffff; --surface-2: #f2f2f3;
  --text: #141416; --muted: #6b6f76; --border: #e5e6e8;
  --primary: #141416; --on-primary: #ffffff;
  --free: #16a34a; --free-soft: #ecfdf3; --busy: #dc2626; --busy-soft: #fdf1f1;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(20, 20, 22, .06); --shadow-lg: 0 16px 48px rgba(20, 20, 22, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---------- Üst bar ---------- */
.hdr { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.hdr-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }

/* ---------- Yerleşim ---------- */
.main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
.ftr { text-align: center; padding: 10px 16px 24px; }
.h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 6px 0 14px; text-wrap: balance; }
.view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.back { border: none; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 6px 0; cursor: pointer; }
.back:hover { color: var(--text); }
/* Belirgin geri butonu (mobilde rahat okunur ve tıklanır) */
.backbtn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px;
  cursor: pointer; margin: 2px 0 14px; min-height: 44px; box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, transform .06s;
}
.backbtn:hover { background: var(--surface-2); border-color: var(--text); }
.backbtn:active { transform: translateY(1px); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Adımlar ---------- */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.step i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--border); color: var(--text); font-size: 11px; }
.step.active { background: var(--primary); color: var(--on-primary); }
.step.active i { background: rgba(255,255,255,.2); color: #fff; }
.step.done i { background: var(--free); color: #fff; }

/* ---------- Düğmeler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .06s, background .15s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 8px; }
.link { border: none; background: none; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; }

/* ---------- Kartlar (şube / kuaför) ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
.card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; cursor: pointer; box-shadow: var(--shadow); transition: transform .08s, border-color .15s; display: flex; flex-direction: column; gap: 10px; }
.card:hover { border-color: var(--text); }
.card:active { transform: scale(.985); }
.card.branch { min-height: 110px; justify-content: space-between; }
.card-name { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.card-sub { font-size: 12px; color: var(--muted); }
/* Fotoğraf yoksa: baş harfli, yumuşak gradyanlı yer tutucu (mockup) */
.avatar { width: 100%; aspect-ratio: 1; border-radius: 12px; background: linear-gradient(145deg, #eeeff2, #d9dbe1); overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 34px; color: #4b5059; letter-spacing: .02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.branch-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 20px; }

/* ---------- Tarih şeridi ---------- */
.barber-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.barber-pill .mini-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.day { flex: none; scroll-snap-align: start; width: 64px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: center; cursor: pointer; transition: background .12s, border-color .12s; }
.day .dow { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day .dom { font-size: 20px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.day .mon { font-size: 11px; color: var(--muted); }
.day.today { border-color: var(--text); }
.day.selected { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day.selected .dow, .day.selected .mon { color: rgba(255,255,255,.75); }
.day:disabled { opacity: .35; cursor: default; }

/* ---------- Saat ızgarası ---------- */
.slot-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.slot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.free { background: var(--free); } .lg.busy { background: var(--busy); } .lg.off { background: var(--border); }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .slot-grid { grid-template-columns: repeat(4, 1fr); } }
.slot { padding: 12px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; cursor: pointer; text-align: center; position: relative; transition: background .12s, border-color .12s, transform .06s; }
.slot:active { transform: scale(.97); }
.slot.free { border-color: #cfe9d8; background: var(--free-soft); }
.slot.free:hover { border-color: var(--free); }
.slot.selected, .slot.selected:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.slot.busy { background: var(--busy-soft); border-color: #f2c7c7; color: var(--busy); cursor: not-allowed; text-decoration: line-through; }
.slot.busy::after, .slot.off::after, .slot.past::after { content: attr(data-note); display: block; font-size: 10px; font-weight: 700; margin-top: 2px; opacity: .8; text-decoration: none; }
.slot.off, .slot.past { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; }
.slot-empty { padding: 20px 10px; text-align: center; }

/* ---------- Yapışkan devam çubuğu ---------- */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.sticky-cta > * { max-width: 760px; }
.sticky-cta { display: flex; justify-content: center; }
.sticky-cta .cta-sum { flex: 1; font-weight: 700; font-size: 14px; align-self: center; }
.sticky-cta .btn { flex: none; }
@media (min-width: 760px) { .sticky-cta { padding-left: calc((100vw - 760px) / 2 + 16px); padding-right: calc((100vw - 760px) / 2 + 16px); } }

/* ---------- Form / özet ---------- */
.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input { width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(20,20,22,.08); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 6px; }
.summary-card .k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.summary-card .v { font-weight: 800; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.summary-card .full { grid-column: 1 / -1; }
.otp-title { font-weight: 800; font-size: 15px; margin: 0 0 6px; }
.otp-help { margin-top: 8px; }
.otp { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.otp-row { display: flex; gap: 8px; margin-top: 8px; }
.otp-row input { flex: 1; letter-spacing: .3em; font-weight: 800; font-size: 20px; text-align: center; }
.err { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--busy-soft); color: var(--busy); font-size: 14px; font-weight: 600; }

/* ---------- Bitti / randevularım ---------- */
.done { text-align: center; padding: 10px 0; }
.done-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--free-soft); color: var(--free); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 10px auto 12px; }
.done .summary-card { text-align: left; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; font-size: 16px; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
/* Onay ekranı: teşekkür + Instagram takip kartı */
.follow-card { margin: 14px auto 4px; max-width: 420px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.follow-text { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; line-height: 1.5; }
.follow-text b { font-size: 17px; font-weight: 800; }
.btn.insta { width: 100%; border: none; color: #fff; background: linear-gradient(45deg, #f58529 0%, #dd2a7b 50%, #8134af 100%); text-decoration: none; }
.btn.insta svg { width: 18px; height: 18px; flex: none; }
.btn.insta:hover { opacity: .92; }
.appt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.appt-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.appt-when { font-weight: 800; font-size: 16px; }
.appt-who { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pill { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--free-soft); color: var(--free); white-space: nowrap; }
.pill.cancelled { background: var(--surface-2); color: var(--muted); }
.pill.past { background: var(--surface-2); color: var(--muted); }
.appt-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.appt-actions .btn { padding: 9px 14px; font-size: 14px; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.my-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.empty { padding: 22px 12px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Bildirim / yükleniyor ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; color: #fff; background: #141416; box-shadow: var(--shadow-lg); max-width: 92vw; text-align: center; }
.toast.success { background: var(--free); } .toast.error { background: var(--busy); } .toast.warn { background: #b45309; }
.loading { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
