/* ==========================================================================
   SERBESTSÖZ — telefon uygulamaları (tur2 pwa)
   - /uygulama sayfası (.pwa-page): kahraman + telefon çizimi, özellikler, cihaz tarifleri, yönetim uygulaması, SSS
   - Kurulum şeridi (.pwa-strip) ve tarif penceresi (.modal--install, mobilde alt sayfa)
   Bu dosyayı /uygulama doğrudan yükler; diğer sayfalarda pwa.js yalnızca şerit/pencere açılırken ekler.
   Düğmeler (data-install) app.css + admin.css'te; renkler app.css belirteçleri (Kâğıt / Gece).
   ========================================================================== */

/* --- Ortak: adım listesi (sayfa + pencere) --- */
.pwa-steps { counter-reset: pwa-step; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.pwa-step {
  counter-increment: pwa-step;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.pwa-step strong { color: var(--text); font-weight: 700; }
.pwa-step-ico {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.pwa-step-ico .ico { width: 19px; height: 19px; }
.pwa-step-ico::after {
  content: counter(pwa-step);
  position: absolute;
  top: -6px;
  left: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 10.5px/1 var(--font-sans);
  box-shadow: 0 0 0 2px var(--surface-solid);
}
.pwa-step-text { min-width: 0; padding-top: 8px; }

.pwa-platform-note,
.pwa-sheet-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--chip-bg);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.pwa-platform-note .ico,
.pwa-sheet-note .ico { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--info); }

/* --- Tarif penceresi --- */
@media (min-width: 768px) { .modal--install { width: min(500px, calc(100vw - 32px)); } }
.pwa-sheet-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow-1); }
.pwa-sheet-lead { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* --- Kurulum şeridi (ikinci ziyaretten sonra; kapatınca 30 gün yok) --- */
.pwa-strip {
  position: fixed;
  z-index: calc(var(--z-bottom, 50) + 5);
  left: 50%;
  bottom: calc(var(--bottom-h, 64px) + var(--safe-b, 0px) + 10px);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(520px, calc(100vw - 20px));
  padding: 10px 8px 10px 12px;
  border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--hairline), var(--highlight), var(--shadow-3);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity .3s ease, transform .5s var(--ease-out);
}
.pwa-strip.is-in { opacity: 1; transform: translate(-50%, 0); }
[data-theme="kagit"] .pwa-strip {
  background: var(--surface-solid);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 0 0 1px var(--border), 4px 4px 0 -1px var(--accent), 8px 8px 0 -2px var(--navy), var(--shadow-2);
}
@media (min-width: 768px) { .pwa-strip { bottom: 22px; } }
.pwa-strip-icon { flex: none; width: 44px; height: 44px; border-radius: 11px; box-shadow: var(--shadow-1); }
.pwa-strip-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.pwa-strip-text strong { font-size: 14px; color: var(--text); }
.pwa-strip-text span { font-size: 12.5px; color: var(--text-3); }
.pwa-strip-go, .pwa-strip-x { flex: none; }
@media (max-width: 359px) { .pwa-strip-text span { display: none; } }

/* --- /uygulama sayfası --- */
.pwa-page { display: grid; gap: clamp(36px, 5vw, 64px); padding-bottom: 24px; }

.pwa-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  padding-top: 8px;
}
@media (min-width: 900px) { .pwa-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; } }
.pwa-hero .page-title { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); }
.pwa-hero .page-title em { font-style: italic; color: var(--accent-text); }
.pwa-hero .page-sub { max-width: 52ch; font-size: 16px; }
.pwa-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pwa-state {
  max-width: 52ch;
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--chip-bg);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
[data-install-always].is-done { opacity: .75; }

/* Telefon çizimi (süs; ekran okuyucudan gizli) — iki uygulama yan yana ana ekranda */
.pwa-phone {
  justify-self: center;
  width: min(270px, 74vw);
  aspect-ratio: 9 / 18.5;
  padding: 11px;
  border-radius: 44px;
  background: linear-gradient(160deg, #1B2A44, #070E1B 60%);
  box-shadow: inset 0 0 0 1.5px rgba(243, 239, 230, .14), 0 2px 0 rgba(255, 255, 255, .05), 0 50px 90px -40px rgba(2, 10, 24, .75);
  transform: rotate(-3deg);
  animation: pwa-float 7s ease-in-out infinite;
}
[data-theme="kagit"] .pwa-phone { box-shadow: inset 0 0 0 1.5px rgba(243, 239, 230, .14), 9px 9px 0 -2px var(--accent), 18px 18px 0 -4px var(--navy), 0 50px 80px -40px rgba(2, 20, 40, .45); }
.pwa-phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 14px 12px;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 15% 0%, rgba(30, 72, 130, .9), rgba(4, 29, 59, 0) 62%),
    radial-gradient(90% 60% at 100% 100%, rgba(200, 38, 42, .55), rgba(200, 38, 42, 0) 62%),
    #041D3B;
}
.pwa-phone-bar { display: flex; align-items: center; justify-content: space-between; height: 22px; margin-bottom: 18px; font: 700 11px/1 var(--font-sans); color: #F3EFE6; }
.pwa-phone-notch { width: 72px; height: 20px; border-radius: 12px; background: #02060D; }
.pwa-phone-sig { width: 26px; height: 9px; border-radius: 3px; background: linear-gradient(90deg, #F3EFE6 70%, rgba(243, 239, 230, .35) 70%); }
.pwa-phone-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 12px; padding: 4px 2px; }
.pwa-tile { position: relative; aspect-ratio: 1; border-radius: 24%; background: rgba(243, 239, 230, .13); box-shadow: inset 0 0 0 1px rgba(243, 239, 230, .06); }
.pwa-tile--app { background: none; box-shadow: none; }
.pwa-tile--app img { display: block; width: 100%; height: 100%; border-radius: 24%; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6); }
.pwa-tile--app b {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font: 600 9.5px/1 var(--font-sans);
  color: #F3EFE6;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.pwa-tile--app:not(.pwa-tile--admin)::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 28%;
  border: 2px solid rgba(243, 239, 230, .75);
  opacity: 0;
  animation: pwa-ping 2.8s var(--ease-out) 1s infinite;
}
.pwa-phone-dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: auto; padding: 10px; border-radius: 24px; background: rgba(243, 239, 230, .1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes pwa-float { 50% { transform: rotate(-3deg) translateY(-10px); } }
@keyframes pwa-ping { 0% { opacity: .9; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.18); } }
@media (max-width: 899px) {
  .pwa-phone { width: min(200px, 56vw); transform: none; animation: none; }
  .pwa-phone-screen { padding: 10px 11px; border-radius: 30px; }
  .pwa-phone-grid { gap: 20px 9px; }
}

/* Özellikler */
.pwa-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.pwa-feature h2 { margin: 14px 0 6px; font: 600 17.5px/1.25 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.pwa-feature p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.pwa-feature-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--accent-text); background: var(--accent-soft); }
.pwa-feature-ico .ico { width: 22px; height: 22px; }

/* Tarifler: okurun cihazına uyan kart öne gelir (pwa.js .is-current) */
.pwa-howto .section-head { margin-top: 0; }
.pwa-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; align-items: start; }
.pwa-platform.is-current { order: -1; box-shadow: inset 0 0 0 1.5px var(--accent), var(--highlight), var(--shadow-2); }
.pwa-platform-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pwa-platform-head > div { flex: 1; min-width: 0; }
.pwa-platform-head h3 { margin: 0; font: 600 18px/1.2 var(--font-display); color: var(--text); }
.pwa-platform-head p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-3); }
.pwa-platform-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--text); background: var(--chip-bg); box-shadow: var(--hairline); }
.pwa-platform-ico .ico { width: 20px; height: 20px; }
.pwa-mine { flex: none; align-self: flex-start; color: var(--accent-text); background: var(--accent-soft); }

/* Yönetim uygulaması (yalnız ekip) */
.pwa-admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 720px) { .pwa-admin { grid-template-columns: auto minmax(0, 1fr); gap: 28px; } }
.pwa-admin-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow-2); }
.pwa-admin-body > p { margin: 10px 0 0; max-width: 64ch; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.pwa-admin-body .section-title { margin: 0; }
.pwa-admin-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.pwa-admin-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.pwa-admin-list .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent-text); }
.pwa-admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }
.pwa-admin-actions .muted { flex: 1 1 260px; margin: 0; font-size: 13px; line-height: 1.5; }

/* SSS */
.pwa-faq { display: grid; gap: 10px; max-width: 760px; }
.pwa-faq .section-title { margin: 0 0 6px; }
.pwa-qa { border-radius: 14px; background: var(--surface); box-shadow: var(--hairline); }
.pwa-qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.pwa-qa summary::-webkit-details-marker { display: none; }
.pwa-qa summary::after { content: '+'; flex: none; font: 400 22px/1 var(--font-sans); color: var(--text-3); transition: transform .3s var(--ease-out); }
.pwa-qa[open] summary::after { transform: rotate(45deg); }
.pwa-qa summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 14px; }
.pwa-qa p { margin: 0; padding: 0 16px 16px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }

/* Hareket azaltma + yazdırma */
@media (prefers-reduced-motion: reduce) {
  .pwa-phone, .pwa-tile--app::after { animation: none !important; }
  .pwa-strip { transition: none; }
}
.reduce-motion .pwa-phone, .reduce-motion .pwa-tile--app::after { animation: none !important; }
.reduce-motion .pwa-strip { transition: none; }
@media print { .pwa-strip, .pwa-phone { display: none !important; } }
