/* =====================================================================
   Koza — ortak ekranlar (Yön C · Canlı ve modern)
   Giriş / kayıt (app.js) · açılış · bildirim zili ve kutusu (inbox.js) ·
   bildirim izni kartı/bandı ve "Bildirimler" ayar kartı (push.js).
   Yalnızca app.css tokenları kullanılır (ham hex yok). Sınıf API'si: docs/TASARIM.md §6
   ===================================================================== */

/* ---------- 0. Ortak düzeltme ----------
   .p-app::before mesh'i yanlardan 40px taşar; telefonda yerleşim görünümünü genişletip
   (innerWidth 430) alt pencereleri ekranın dışına itiyordu. Taşmayı kırp (sticky/fixed etkilenmez). */
.p-app { overflow-x: clip; }

.auth [hidden], .inbox-sheet [hidden] { display: none !important; }

/* ---------- 1. Giriş / kayıt ---------- */
/* Ekranın tek gradyan anı: marka mesh zemini. Kartlar DÜZ yüzey (cam yok). */
.auth {
  position: relative; isolation: isolate;
  display: block;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(22px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(32px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  background:
    radial-gradient(85% 34% at 0% 0%, var(--mesh-a), transparent 72%),
    radial-gradient(80% 36% at 100% 2%, var(--mesh-b), transparent 72%),
    radial-gradient(70% 26% at 85% 40%, var(--mesh-c), transparent 72%),
    var(--bg);
}
.auth-wrap { position: relative; width: 100%; max-width: 440px; margin: 0 auto; }

.auth-intro .brand-row { gap: 12px; }
.auth-intro .brand-mark { width: 44px; height: 44px; border-radius: 13px; box-shadow: var(--shadow-1); }
.auth-intro .brand-name { font-size: 24px; }
.auth-intro .brand-sub { font-size: var(--fs-sm); }
.auth .auth-title {
  margin-top: 22px; max-width: 16ch;
  font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
}
.auth-title span { color: var(--brand-ink); }
.auth-care { margin-top: 14px; max-width: 100%; }
.auth-care > span:not(.avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-points { display: none; }

.auth-main { margin-top: 22px; }
.auth-card { padding: 22px 20px 20px; border-radius: var(--r-xl); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2); }
.auth-card h2 { margin-bottom: 2px; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.auth-lead { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.auth-form { margin-top: 18px; }
.auth-form > * + * { margin-top: 14px; }
.auth-form > h2 + .auth-lead { margin-top: 4px; }
.auth-form .btn.lg { margin-top: 18px; }
.auth-form .err { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bugun-bg); box-shadow: inset 0 0 0 1px var(--bugun-line); }
.auth-alt { margin-top: 12px; text-align: center; font-size: 15px; color: var(--ink-2); }
.auth-alt a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 750; color: var(--brand-ink); text-decoration-color: var(--brand-line); text-underline-offset: 3px; }
.auth-main > .auth-alt { margin-top: 10px; }

/* Şifre alanı + göster/gizle */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 54px; }
.pw-toggle { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pw-toggle svg.i { width: 21px; height: 21px; }
.pw-toggle[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }

/* Demo girişleri */
.auth-demo { margin-top: 22px; }
.auth-demo .divider { margin: 0 0 12px; font-size: var(--fs-label); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.auth-demo .divider::before, .auth-demo .divider::after { background: var(--line-strong); }
.demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 116px; padding: 14px;
  border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  text-align: left; cursor: pointer;
  transition: box-shadow var(--dur), transform .06s;
}
.demo-btn:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-2); }
.demo-btn:active { transform: scale(.985); }
.demo-btn:disabled { cursor: default; opacity: .6; }
.demo-btn[aria-busy="true"] { opacity: 1; box-shadow: inset 0 0 0 2px var(--brand-solid), var(--shadow-1); }
.demo-btn::after { content: ""; position: absolute; right: 14px; top: 18px; width: 18px; height: 18px; background: var(--muted);
  -webkit-mask: var(--demo-arrow) center / contain no-repeat; mask: var(--demo-arrow) center / contain no-repeat; }
.demo-btn .demo-txt { display: flex; flex-direction: column; gap: 1px; }
.demo-btn b { font-size: var(--fs-body); font-weight: 800; line-height: 1.25; }
.demo-btn small { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; line-height: 1.3; }
.demo-note { margin-top: 10px; text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
:root { --demo-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }

/* Kayıt: adım göstergesi */
.auth-reg .auth-title, .auth-reg .auth-care { display: none; }
.auth-reg .auth-main { margin-top: 18px; }
.reg-progress { margin-bottom: 18px; }
.reg-step .kicker { color: var(--brand-ink); }
.reg-step .reg-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reg-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.reg-steps i { display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); transition: background-color var(--dur); }
.reg-steps li.done i, .reg-steps li.on i { background: var(--brand-solid); }
.reg-steps span { display: block; margin-top: 6px; font-size: var(--fs-label); font-weight: 700; color: var(--muted); line-height: 1.2; }
.reg-steps li.on span { color: var(--ink); font-weight: 800; }
.reg-steps li.done span { color: var(--ink-2); }
.reg .auth-form { margin-top: 0; }
.reg .auth-form > h2 + .auth-lead { margin-top: 4px; }

.opt { margin-left: 4px; font-style: normal; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.input.invite { text-transform: uppercase; font-weight: 750; letter-spacing: .04em; }

/* Tarih türü segmenti: uzun etiketler telefonda iki satıra inebilir */
.reg-seg label { white-space: normal; min-height: 48px; padding: 6px 10px; }
.reg-seg label > span { justify-content: center; }

/* Gebelik haftası önizlemesi (kahramanın küçük kardeşi; gradyansız) */
.ga-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line);
}
.ga-week { display: flex; align-items: center; gap: 8px; color: var(--brand-ink); }
.ga-num { font-size: 46px; line-height: .9; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ga-unit { display: flex; flex-direction: column; line-height: 1.1; }
.ga-unit b { font-size: 17px; font-weight: 800; }
.ga-unit small { font-size: var(--fs-xs); font-weight: 700; }
.ga-edd { text-align: right; }
.ga-edd small { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 650; }
.ga-edd b { display: block; font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

.reg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; align-items: end; }
.reg-grid .field > span:first-child { line-height: 1.25; }
@media (max-width: 359px) { .reg-grid { grid-template-columns: minmax(0, 1fr); } }
.reg .input-unit .input { font-size: var(--fs-body); font-weight: 600; letter-spacing: 0; padding-right: 44px; }
.reg-checks { display: grid; gap: 8px; }
.reg-checks .check span { font-size: 15px; font-weight: 600; }
.kvkk-note { display: flex; margin-top: 8px; border-radius: var(--r-sm); padding: 8px 12px 8px 10px; }
.check:has(input[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--bugun-ink); }
.auth .kvkk-text { max-height: 260px; box-shadow: inset 0 0 0 1px var(--line); }
.check.consent { box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.check.consent span { font-size: 15px; }
.reg-acts { display: flex; gap: 10px; margin-top: 20px; }
.reg-acts .btn { min-height: 52px; }
.reg-acts .btn.ghost { flex: none; min-width: 104px; padding: 0 16px; }
.reg-acts .btn.grow { flex: 1; }
.reg-acts .btn svg.i { width: 18px; height: 18px; }

/* Geniş ekran: solda marka anlatısı, sağda kart */
@media (min-width: 960px) {
  .auth { display: grid; place-items: center; padding: calc(40px + var(--safe-t)) 48px calc(40px + var(--safe-b)); }
  .auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 80px; align-items: center; max-width: 1100px; }
  .auth .auth-title { margin-top: 36px; font-size: 54px; line-height: 1.04; letter-spacing: -.028em; max-width: 600px; }
  .auth-reg .auth-title, .auth-reg .auth-care { display: revert; }
  .auth-reg .auth-care { display: inline-flex; }
  .auth-care { margin-top: 22px; }
  .auth-points { display: grid; gap: 12px; margin: 34px 0 0; padding: 0; list-style: none; max-width: 420px; }
  .auth-points li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-body); font-weight: 650; color: var(--ink-2); }
  .auth-main, .auth-reg .auth-main { margin-top: 0; }
}

/* ---------- 2. Açılış ekranı (index.html .boot) ---------- */
.boot {
  background:
    radial-gradient(70% 40% at 0% 0%, var(--mesh-a), transparent 72%),
    radial-gradient(70% 40% at 100% 0%, var(--mesh-b), transparent 72%),
    var(--bg);
}
.boot .brand-mark { border-radius: 16px; box-shadow: var(--shadow-1); animation: koza-breathe 1.6s ease-in-out infinite; }
@keyframes koza-breathe { 50% { transform: scale(.94); opacity: .85; } }

/* ---------- 3. Bildirim zili (hasta başlığı) ---------- */
/* <button class="bell" data-inbox aria-label="Bildirimler, 2 okunmamış">svg<span class="badge" data-inbox-badge>2</span></button> */
.bell { color: var(--ink); }
.bell .badge { top: -2px; right: -2px; min-width: 20px; }
.bell:active { transform: scale(.96); }

/* ---------- 4. Bildirim kutusu (alt pencere) ---------- */
.inbox-sheet .sheet-body > h2:first-child { margin-bottom: 2px; }
.ib-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.ib-count { display: inline-block; font-size: var(--fs-sm); font-weight: 650; color: var(--muted); }
.ib-count b { color: var(--brand-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.ib-count svg.i { width: 17px; height: 17px; margin: -3px 6px 0 0; color: var(--ok-ink); }
.ib-bar .linkbtn { font-size: var(--fs-sm); }
.ib-list { margin-top: 4px; }
.ib-list .skel-card { background: transparent; box-shadow: none; padding: 8px 0; }
.ib-day { margin: 12px 0 2px; font-size: var(--fs-label); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ib-group:first-child .ib-day { margin-top: 4px; }
.inbox-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  width: calc(100% + 20px); min-height: 64px; margin: 0 -10px; padding: 12px 10px;
  position: relative;
  border: 0; border-radius: var(--r-sm); background: none;
}
.inbox-item + .inbox-item::before { content: ""; position: absolute; left: 58px; right: 10px; top: 0; height: 1px; background: var(--line); }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item:hover::before, .inbox-item:hover + .inbox-item::before { visibility: hidden; }
.inbox-item .tile.sm { width: 36px; height: 36px; border-radius: 12px; }
.inbox-item .tile.sm svg.i { width: 18px; height: 18px; }
.inbox-item .tile.neutral { background: var(--surface-2); color: var(--ink-2); }
.ib-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ib-cat { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); line-height: 1.3; }
.ib-cat.acil { color: var(--acil-ink); }
.ib-text { font-size: 15.5px; font-weight: 550; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }
.inbox-item.unread .ib-text { font-weight: 750; color: var(--ink); }
.ib-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; padding-top: 1px; }
.ib-time { font-size: var(--fs-xs); font-weight: 650; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.inbox-item.unread .ib-time { color: var(--brand-ink); }
.inbox-item .udot { width: 9px; height: 9px; box-shadow: 0 0 0 3px var(--brand-soft); }
.inbox-sheet .empty { padding: 32px 12px 20px; }

/* ---------- 5. Bildirim izni: kart ("Bugün" kartının ALTINDA) ve tek satırlık bant ---------- */
.push-slot:empty { display: none; }
.push-prompt { gap: 2px 12px; padding: 16px; }
.push-prompt h3 { font-size: 16px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; margin-top: 1px; }
.push-prompt .pp-body p { margin-top: 3px; font-size: 15px; line-height: 1.42; color: var(--ink-2); }
.push-prompt .pp-x { margin: -6px -6px 0 0; color: var(--muted); }
.push-prompt .pp-x svg.i { width: 20px; height: 20px; }
.push-prompt .pp-acts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.push-prompt .pp-acts .btn { width: 100%; }
.push-prompt .pp-privacy { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.push-prompt .pp-privacy svg.i { width: 15px; height: 15px; color: var(--teal-ink); }

.push-banner { gap: 12px; padding: 8px 8px 8px 12px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.push-banner .pb-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.push-banner .pb-ic svg.i { width: 19px; height: 19px; }
.push-banner .grow { font-size: var(--fs-sm); line-height: 1.35; }
.push-banner b { color: var(--ink); font-weight: 750; }
.push-banner .pb-sub { color: var(--muted); font-weight: 600; }
.push-banner .pb-x { color: var(--muted); }
.push-banner .pb-x svg.i { width: 20px; height: 20px; }
.d-main .push-slot:not(:empty) { margin-bottom: 16px; }
/* Dar yuvada (telefon ya da doktor panelinin sağ sütunu) bant iki satıra iner: [ikon][metin][×] / [düğme] */
.push-slot { container: pushslot / inline-size; }
@container pushslot (max-width: 560px) {
  .push-banner { flex-wrap: wrap; align-items: flex-start; padding: 10px 6px 12px 12px; row-gap: 8px; }
  .push-banner .pb-ic { margin-top: 2px; }
  .push-banner .grow { flex: 1 1 0; padding-top: 2px; }
  .push-banner .pb-sub { display: block; }
  .push-banner .pb-x { margin: -4px 0 0; }
  .push-banner .btn { order: 3; flex: 1 0 100%; margin-left: 48px; max-width: calc(100% - 54px); }
}
@supports not (container-type: inline-size) {
  @media (max-width: 600px) {
    .push-banner { flex-wrap: wrap; }
    .push-banner .grow { flex: 1 1 0; }
    .push-banner .btn { order: 3; flex: 1 0 100%; margin-left: 48px; max-width: calc(100% - 54px); }
  }
}

/* ---------- 6. "Bildirimler" ayar kartı ---------- */
.push-card .card-title { margin-bottom: 12px; }
.push-pill svg.i { stroke-width: 2.4; }
.push-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.push-status .tile { width: 40px; height: 40px; border-radius: 13px; background: var(--surface); }
.push-status .tile.ok { background: var(--ok-bg); }
.push-status .tile.violet { background: var(--accent-soft); }
.push-status .tile.peach { background: var(--peach-soft); }
.push-status p { flex: 1; min-width: 0; padding-top: 1px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.push-status.ok { background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok-line); }
.push-status.ok .tile { background: var(--surface); }
.push-status.ok p { color: var(--ink); }
.push-hint { margin-top: 10px; font-size: var(--fs-sm); }
.push-acts { margin-top: 12px; }
@media (max-width: 600px) { .push-acts { display: grid; grid-template-columns: minmax(0, 1fr); } .push-acts .btn { width: 100%; } }
.push-test-out { display: flex; margin-top: 10px; border-radius: var(--r-sm); padding: 8px 12px; }
.push-test-out.hidden { display: none; }

.push-card .push-sect, .push-sect { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ps-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.ps-h svg.i { width: 18px; height: 18px; color: var(--accent-ink); }
.ps-h em { font-style: normal; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.ps-cat { min-height: 56px; gap: 12px; }
.ps-cat .tile.sm { width: 34px; height: 34px; border-radius: 11px; }
.ps-cat .tile.sm svg.i { width: 18px; height: 18px; }
.ps-cat .grow { font-size: 15px; font-weight: 650; line-height: 1.3; color: var(--ink); }
.ps-cat .grow .hint { font-weight: 600; }
.ps-cat .switch:disabled { opacity: .62; }

.push-sect.quiet summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; border-radius: var(--r-xs); }
.push-sect.quiet summary::-webkit-details-marker { display: none; }
.push-sect.quiet summary .ps-h { flex: 1; min-width: 0; margin: 0; }
.push-sect.quiet summary > svg.i { width: 20px; height: 20px; color: var(--muted); transition: transform var(--dur) var(--ease); }
.push-sect.quiet[open] summary > svg.i { transform: rotate(180deg); }
.push-sect.quiet .chip svg.i { width: 14px; height: 14px; }
.ps-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ps-row .ps-h { margin: 0; }
.ps-off { font-size: var(--fs-xs); font-weight: 650; color: var(--muted); }
.quiet-grid { margin-top: 8px; }
.quiet-clear { display: inline-block; margin-top: 10px; font-size: var(--fs-sm); }
.push-sect .err { margin-top: 8px; }

.ps-devices { margin-top: 2px; }
.ps-dev { min-height: 60px; padding: 10px 0; }
.ps-dev .tile.sm { width: 34px; height: 34px; border-radius: 11px; }
.ps-dev .tile.sm svg.i { width: 18px; height: 18px; }
.ps-dev .t { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 15px; }
.ps-dev .chip { min-height: 24px; padding: 0 9px; }
.ps-empty { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.ps-privacy {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.45; color: var(--ink-2);
}
.ps-privacy svg.i { width: 18px; height: 18px; flex: none; color: var(--teal-ink); }

/* telefonda gövde ≥ 15px */
@media (max-width: 600px) {
  .ps-privacy, .ps-off, .ib-cat, .ib-time { font-size: 14px; }
  .push-prompt .pp-privacy, .ps-empty { font-size: 15px; }
}
