/* ==========================================================================
   HERO — ortalanmış başlık + "kaynaklar → portal → siz" akış sahnesi
   ========================================================================== */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(48px, 7vw, 96px));
  padding-bottom: clamp(64px, 8vw, 112px);
  isolation: isolate;
  overflow: hidden;
}

/* Arka plan: üstte lacivert bir ışık, altta beyaza eriyen ince nokta deseni */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgb(30 58 109 / .1), transparent 70%),
    radial-gradient(30% 30% at 88% 12%, rgb(211 20 28 / .06), transparent 70%),
    linear-gradient(180deg, var(--bg-alt), var(--bg) 85%);
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(11 31 69 / .13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000, transparent 75%);
}

/* ---------- Metin ---------- */
.hero__copy {
  display: grid;
  justify-items: center;
  gap: 24px;
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}

.hero__eyebrow { transition: border-color .2s, box-shadow .2s; }
.hero__eyebrow:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.hero__eyebrow .i { width: 14px; height: 14px; color: var(--muted); }

.hero__title {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.04;
}

.hero__lead {
  max-width: 62ch;
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-2);
}

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.hero__trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero__trust .i {
  width: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-600);
  stroke-width: 3;
}

/* Giriş animasyonu: öğeler sırayla belirir */
.js [data-hero-in] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--hero-i, 0) * 90ms);
}
.js [data-hero-in].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   AKIŞ SAHNESİ
   Kaynak düğümleri ─► portal gelen kutusu ─► bildirim kanalları.
   Çizgiler JS ile düğümlerin gerçek konumlarından çizilir.
   ========================================================================== */

.flow {
  --c-flow: var(--navy-700);
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 660px) minmax(200px, 250px);
  justify-content: space-between;
  align-items: center;
  gap: 48px;
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / .7), rgb(255 255 255 / .95)),
    var(--bg-alt);
  box-shadow: 0 1px 0 rgb(255 255 255 / .8) inset, var(--shadow);
}

.flow__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.flow__lines path {
  fill: none;
  stroke: var(--navy-200);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  transition: stroke .3s;
}
.flow__lines path.is-active { stroke: var(--c-flow); stroke-dasharray: none; }

.flow__dot { fill: var(--red-600); }
.flow__dot-glow { fill: var(--red-600); opacity: .2; }

.flow__label {
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.flow__col { position: relative; z-index: 1; display: grid; gap: 10px; }

/* ---------- Düğüm (kaynak / kanal) ---------- */
.flow-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition: border-color .3s, box-shadow .3s, transform .4s var(--ease-out);
}
.flow-node.is-active {
  border-color: var(--navy-200);
  box-shadow: 0 0 0 4px var(--navy-50), var(--shadow-sm);
  transform: translateX(var(--nudge, 0));
}
.flow__sources .flow-node { --nudge: 4px; }
.flow__outputs .flow-node { --nudge: -4px; }

.flow-node__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--navy-800);
  transition: background-color .3s, color .3s;
}
.flow-node__icon .i { width: 18px; height: 18px; }
.flow-node.is-active .flow-node__icon { background: var(--navy-900); color: #fff; }

.flow-node__text { display: grid; min-width: 0; line-height: 1.3; }
.flow-node__text strong { font-size: 14px; font-weight: 700; }
.flow-node__text small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kanal düğümlerinin marka renkleri */
.flow-node[data-flow-channel="whatsapp"] .flow-node__icon { background: #e3f6ea; color: #1a9c4f; }
.flow-node[data-flow-channel="whatsapp"].is-active .flow-node__icon { background: #1fa855; color: #fff; }
.flow-node[data-flow-channel="sms"] .flow-node__icon,
.flow-node[data-flow-channel="mail"] .flow-node__icon { background: var(--red-50); color: var(--red-600); }
.flow-node[data-flow-channel="sms"].is-active .flow-node__icon,
.flow-node[data-flow-channel="mail"].is-active .flow-node__icon { background: var(--red-600); color: #fff; }

/* Kanaldaki son mesaj güncellenince kısa bir vurgu */
.flow-node small.is-new { animation: msg-in .5s var(--ease-out); color: var(--ink-2); }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Portal penceresi ---------- */
.flow__app {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.app-bar__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--navy-900);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.06em;
}
.app-bar__mark b { color: #ff5a61; }
.app-bar__title { display: grid; line-height: 1.25; }
.app-bar__title strong { font-size: 14px; font-weight: 700; }
.app-bar__title span { font-size: 12px; color: var(--muted); }

/* Filtre sekmeleri (görsel) */
.app-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.app-tabs > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.app-tabs > span.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.app-tabs > span b {
  min-width: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--navy-50);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.app-tabs > span.is-on b { background: var(--navy-900); color: #fff; }

/* ---------- Gelen kutusu ---------- */
.inbox {
  --row-h: 64px;
  position: relative;
  height: calc(var(--row-h) * 4);
  overflow: hidden;
}

.inbox-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: var(--row-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 1.2s;
}

.inbox-row__src {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-alt);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--navy-800);
}

.inbox-row__main { display: grid; min-width: 0; line-height: 1.35; }
.inbox-row__main b {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-row__main small {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-row__meta { display: grid; justify-items: end; gap: 4px; }
.inbox-row__meta time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Yeni gelen satır: yukarıdan iner, kısa süre vurgulu kalır */
.inbox-row.is-entering { animation: inbox-in .7s var(--ease-out); background: #f2f6ff; }
.inbox-row.is-entering .inbox-row__src { background: var(--navy-900); color: #fff; }
@keyframes inbox-in {
  from { margin-top: calc(var(--row-h) * -1); opacity: 0; }
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--muted);
}
.app-foot b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.app-foot .i { width: 15px; height: 15px; }
.app-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Toplu çekim şeridi (sekmelerin üstüne biner) ---------- */
.app-tabs { position: relative; }
.app-sync {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--navy-900);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
}
.app-sync.is-on { opacity: 1; transform: none; }
.app-sync .i { width: 16px; height: 16px; animation: spin 1s linear infinite; }
.app-sync b { margin-left: auto; font-variant-numeric: tabular-nums; }
.app-sync span, .app-sync b { white-space: nowrap; }
.app-sync > span:not(.app-sync__bar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-sync__bar {
  width: 120px;
  height: 6px;
  border-radius: 99px;
  background: rgb(255 255 255 / .15);
  overflow: hidden;
}
.app-sync__bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #3fd39b;
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

/* Sekme sayacı artınca kısa bir vurgu */
.app-tabs > span b.is-bump { animation: bump 1.4s var(--ease-out); }
@keyframes bump {
  0%, 55% { background: var(--red-600); color: #fff; }
  15% { transform: scale(1.25); }
  30% { transform: none; }
}

/* Mevcut satırın durumu değişince: satır parlar, etiket yeniden oturur */
.inbox-row.is-updated { animation: row-flash 1.6s var(--ease-out); }
.inbox-row.is-updated .pill { animation: pop .45s var(--ease-spring); }
@keyframes row-flash { 0%, 30% { background: #effaf4; } }

/* Kanal bildirimi gönderilince portal içinde çıkan onay */
.app-toast {
  position: absolute;
  left: 50%;
  bottom: 56px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
  pointer-events: none;
}
.app-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.app-toast .i {
  width: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 50%;
  background: #3fd39b;
  color: var(--navy-900);
  stroke-width: 3;
}
.app-toast span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Vergi takvimi hatırlatması ---------- */
.app-remind {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: #fff4dc;
  color: var(--amber-600);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
}
.app-remind.is-on { opacity: 1; transform: none; }
.app-remind .i { width: 17px; height: 17px; animation: ring 1s var(--ease-in-out) 2; transform-origin: 50% 10%; }
.app-remind b { margin-left: auto; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }

/* Portal kendi hatırlatmasını üretirken logosu nabız atar */
.flow__app.is-reminding .app-bar__mark { animation: mark-pulse 1.2s var(--ease-out) infinite; }
@keyframes mark-pulse {
  0% { box-shadow: 0 0 0 0 rgb(229 148 0 / .55); }
  100% { box-shadow: 0 0 0 10px rgb(229 148 0 / 0); }
}

.inbox-row__src--cal { background: #fff4dc; color: var(--amber-600); }
.inbox-row__src--cal .i { width: 18px; height: 18px; }
.inbox-row.is-entering .inbox-row__src--cal { background: var(--amber-500); color: #fff; }

/* ---------- Telefon kilit ekranı bildirimi ---------- */
.notif {
  position: absolute;
  right: clamp(16px, 2.5vw, 32px);
  top: -34px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 310px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgb(246 247 250 / .88);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 1px 0 rgb(255 255 255 / .8) inset, 0 24px 48px -16px rgb(7 19 40 / .35), 0 0 0 1px rgb(11 26 51 / .06);
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(.96);
  transition: opacity .35s var(--ease-out), transform .55s var(--ease-spring);
  pointer-events: none;
}
.notif.is-on { opacity: 1; transform: none; }

.notif__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: #1fa855;
  color: #fff;
}
.notif__icon .i { width: 20px; height: 20px; }
.notif[data-channel="sms"] .notif__icon { background: #34c759; }
.notif[data-channel="mail"] .notif__icon { background: var(--red-600); }
.notif[data-channel="mobil"] .notif__icon { background: var(--navy-900); }

.notif__body { display: grid; min-width: 0; line-height: 1.3; }
.notif__top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.notif__body strong { font-size: 14px; }
.notif__text { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1100px) {
  /* Dar ekranda sahne dikey akar: kaynaklar → portal → kanallar; çizgiler gizlenir */
  .flow {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 20px;
    max-width: 640px;
    margin-inline: auto;
  }
  .flow__lines { display: none; }
  .notif { display: none; }
  .flow__col { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow__label { grid-column: 1 / -1; text-align: center; }
  .flow__app { width: 100%; }
  .flow-node.is-active { transform: none; }
}

@media (max-width: 560px) {
  .hero__copy { text-align: left; justify-items: start; }
  .hero__actions { justify-content: flex-start; width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero__trust { justify-content: flex-start; flex-direction: column; gap: 8px; }
  .flow { padding: 14px; border-radius: 24px; margin-inline: calc(var(--gutter) * -.5); }
  .flow__col { gap: 8px; }
  .flow-node { padding: 8px; gap: 10px; border-radius: 12px; }
  .flow-node__icon { width: 30px; height: 30px; border-radius: 8px; }
  .flow-node__text strong { font-size: 13px; }
  .flow-node__text small { display: none; }
  .app-tabs > span:nth-child(n+3) { display: none; }
  .inbox { --row-h: 60px; }
  .inbox-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; padding: 0 12px; }
  .inbox-row__src { width: 32px; height: 32px; font-size: 9.5px; }
  .inbox-row .pill { display: none; }
  .app-foot span:last-child { display: none; }
  .app-sync { gap: 8px; padding: 0 12px; font-size: 12px; }
  .app-sync__bar { width: 56px; flex: none; }
}
.hero__trust b { font-weight: 800; color: var(--ink); }
