/* ==========================================================================
   MOBİL — koyu bölüm: fişin fotoğrafı çekilir → okunur → Excel'e satır olarak düşer
   ========================================================================== */

.app-section {
  position: relative;
  overflow: hidden;
  background: var(--navy-900);
  color: #fff;
  isolation: isolate;
}

/* Logodaki "P" kırmızısından gelen tek, kontrollü ışık */
.app-section::before {
  content: "";
  position: absolute;
  right: -10%;
  top: 10%;
  z-index: -1;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(211 20 28 / .22), transparent 65%);
  filter: blur(20px);
}
.app-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(255 255 255 / .08) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}

.app-section__inner {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: clamp(40px, 5vw, 80px);
}

.app-section__copy { display: grid; gap: 20px; }
.app-section .hl { color: #ff6b72; }
.app-section .section-lead { color: rgb(255 255 255 / .7); }

/* ---------- Animasyonla eş zamanlı adımlar ---------- */
.scan-steps { display: grid; gap: 6px; margin-top: 8px; }
.scan-steps li {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: background-color .4s, border-color .4s;
}
.scan-steps li.is-active {
  background: rgb(255 255 255 / .06);
  border-color: rgb(255 255 255 / .1);
}
.scan-steps__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: rgb(255 255 255 / .07);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1);
  color: rgb(255 255 255 / .75);
  transition: background-color .4s, color .4s, box-shadow .4s;
}
.scan-steps__num .i { width: 19px; height: 19px; }
.scan-steps li.is-active .scan-steps__num { background: var(--red-600); color: #fff; box-shadow: 0 8px 20px -8px rgb(211 20 28 / .8); }
.scan-steps div { display: grid; gap: 2px; }
.scan-steps strong { font-size: 1.0625rem; font-weight: 700; }
.scan-steps div span { font-size: 14.5px; color: rgb(255 255 255 / .6); }

.app-section__note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  font-size: 14px;
  color: rgb(255 255 255 / .55);
}

/* ==========================================================================
   SAHNE: telefon + Excel penceresi, aralarında veri hattı
   ========================================================================== */
.scan {
  position: relative;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.scan__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.scan__lines path {
  fill: none;
  stroke: rgb(255 255 255 / .22);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
}
.scan__lines path.is-active { stroke: #3fd39b; stroke-dasharray: none; }
.scan__dot { fill: #3fd39b; }
.scan__dot-glow { fill: #3fd39b; opacity: .25; }

/* ---------- Telefon ---------- */
.phone-ui {
  position: relative;
  z-index: 1;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(160deg, #2a3550, #0b1222);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / .12),
    0 40px 80px -24px rgb(0 0 0 / .7);
}

.phone-ui__screen {
  position: relative;
  height: 560px;
  border-radius: 36px;
  background: var(--bg-alt);
  color: var(--ink);
  overflow: hidden;
}

.phone-ui__island {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 5;
  width: 92px;
  height: 26px;
  border-radius: 99px;
  background: #05080f;
  transform: translateX(-50%);
}

/* Ekranlar üst üste durur; yalnızca .is-on görünür */
.pscreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 48px 14px 16px;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .45s var(--ease-out), transform .55s var(--ease-out);
  pointer-events: none;
}
.pscreen.is-on { opacity: 1; transform: none; }
.pscreen.is-leaving { opacity: 0; transform: translateX(-24px); }

.pscreen__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
}
.pscreen__bar > .i { width: 20px; height: 20px; color: var(--muted); }
.pscreen__bar div { display: grid; line-height: 1.25; }
.pscreen__bar strong { font-size: 16px; font-weight: 800; }
.pscreen__bar small { font-size: 12px; color: var(--muted); }

/* Fiş listesi */
.plist { display: grid; gap: 8px; }
.plist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
}
.plist li.is-new { animation: plist-in .6s var(--ease-out); }
@keyframes plist-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.plist__ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--navy-800);
}
.plist__ic .i { width: 17px; height: 17px; }
.plist__main { display: grid; min-width: 0; line-height: 1.3; }
.plist__main b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist__main small { font-size: 11.5px; color: var(--muted); }
.plist__ok {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex: none;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-600);
}
.plist__ok .i { width: 13px; height: 13px; stroke-width: 3; }

.pshoot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  margin-top: auto;
  border-radius: 16px;
  background: var(--red-600);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 12px 24px -10px rgb(211 20 28 / .7);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.pshoot .i { width: 20px; height: 20px; }
.pshoot.is-pressed { transform: scale(.95); box-shadow: 0 4px 10px -6px rgb(211 20 28 / .7); }

/* Kamera */
.pscreen--cam { padding: 0; background: #0a0d14; gap: 0; }
.viewfinder {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(80% 60% at 50% 45%, #3a3326, #14110c 80%);
  overflow: hidden;
}
.viewfinder__corners {
  position: absolute;
  inset: 70px 30px 40px;
  background:
    linear-gradient(#fff, #fff) 0 0 / 22px 3px,
    linear-gradient(#fff, #fff) 0 0 / 3px 22px,
    linear-gradient(#fff, #fff) 100% 0 / 22px 3px,
    linear-gradient(#fff, #fff) 100% 0 / 3px 22px,
    linear-gradient(#fff, #fff) 0 100% / 22px 3px,
    linear-gradient(#fff, #fff) 0 100% / 3px 22px,
    linear-gradient(#fff, #fff) 100% 100% / 22px 3px,
    linear-gradient(#fff, #fff) 100% 100% / 3px 22px;
  background-repeat: no-repeat;
  opacity: .9;
}
.viewfinder__scan {
  position: absolute;
  left: 30px; right: 30px;
  top: 70px;
  height: 2px;
  background: #3fd39b;
  box-shadow: 0 0 16px 4px rgb(63 211 155 / .5);
  opacity: 0;
}
.pscreen--cam.is-scanning .viewfinder__scan { animation: scan-sweep 1.3s var(--ease-in-out) forwards; }
@keyframes scan-sweep {
  0% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(330px); }
}

/* Fiş kâğıdı: alt kenarı tırtıklı */
.receipt {
  display: grid;
  gap: 5px;
  width: 168px;
  padding: 16px 14px 20px;
  background: #fbfaf6;
  color: #2a2a2a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  transform: rotate(-3deg);
  box-shadow: 0 20px 30px -10px rgb(0 0 0 / .6);
  -webkit-mask: radial-gradient(5px at 50% 100%, #0000 98%, #000) 50% / 10px 100%;
  mask: radial-gradient(5px at 50% 100%, #0000 98%, #000) 50% / 10px 100%;
}
.receipt b { font-size: 12px; letter-spacing: .02em; }
.receipt small { font-size: 9px; color: #6b6b6b; }
.receipt i { display: block; height: 5px; margin: 2px 6px; border-radius: 2px; background: #dedbd2; }
.receipt i:nth-of-type(2) { margin-right: 30px; }
.receipt p { display: flex; justify-content: space-between; font-size: 10px; }
.receipt__total { padding-top: 5px; border-top: 1px dashed #bbb; font-weight: 700; font-size: 11.5px !important; }

.cam-ctrl {
  display: grid;
  place-items: center;
  height: 96px;
  background: #0a0d14;
}
.shutter {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: inset 0 0 0 3px #0a0d14;
  transition: transform .15s;
}
.pscreen--cam.is-shot .shutter { transform: scale(.88); }
.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.pscreen--cam.is-shot .flash { animation: flash .5s var(--ease-out); }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* Yükleme ve okunan alanlar */
.pupload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pupload__thumb {
  width: 36px;
  height: 46px;
  flex: none;
  border-radius: 4px;
  background:
    repeating-linear-gradient(to bottom, #dedbd2 0 3px, transparent 3px 8px) 6px 8px / 24px 30px no-repeat,
    #fbfaf6;
  box-shadow: 0 2px 6px rgb(0 0 0 / .15);
  transform: rotate(-4deg);
}
.pupload__bar { flex: 1; height: 8px; border-radius: 99px; background: var(--navy-50); overflow: hidden; }
.pupload__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy-700), #3fd39b);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

.pfields {
  display: grid;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.pfields > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
}
/* JS yoksa alanlar dolu görünür; varsa sırayla belirir */
.js .pfields > div:not(.is-in) { opacity: 0; transform: translateX(8px); }
.pfields > div + div { border-top: 1px solid var(--line); }
.pfields > div.is-in { opacity: 1; transform: none; }
.pfields dt { color: var(--muted); }
.pfields dd { font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfields__total { background: var(--navy-50); }
.pfields__total dd { color: var(--navy-900); }

.pdone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  height: 46px;
  border-radius: 14px;
  background: var(--green-100);
  color: var(--green-600);
  font-size: 14px;
  font-weight: 700;
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-spring);
}
.js .pdone:not(.is-in) { opacity: 0; transform: translateY(8px); }
.pdone .i { stroke-width: 3; }
.pdone.is-in { opacity: 1; transform: none; }

/* ---------- Excel penceresi ---------- */
.xls {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .65);
}

.xls__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #1d6f42;
  color: #fff;
}
.xls__logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: #fff;
  color: #1d6f42;
  font-size: 16px;
  font-weight: 800;
}
.xls__title { display: grid; min-width: 0; line-height: 1.3; }
.xls__title strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xls__title small { font-size: 12px; color: rgb(255 255 255 / .75); }

/* Muhasebe programı seçici */
.xls__formats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f3faf6;
}
.xls__formats-label {
  margin-right: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.fmt {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.fmt.is-on { background: #1d6f42; color: #fff; box-shadow: 0 4px 10px -4px rgb(29 111 66 / .6); }
.fmt--more { background: none; box-shadow: none; color: var(--muted); font-weight: 500; }

.xls__table { overflow: hidden; }
.xls table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.xls th,
.xls td {
  padding: 9px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.xls th:nth-child(3), .xls td:nth-child(3),
.xls th:nth-child(2), .xls td:nth-child(2) { text-align: left; }
.xls td:nth-child(3) { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.xls th {
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.xls th:first-child,
.xls td:first-child {
  width: 40px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.xls th:last-child, .xls td:last-child { border-right: 0; }
.xls td:last-child { font-weight: 700; }

/* Yeni satır: hücreler soldan sağa sırayla dolar */
.xls tr.is-new td { background: #eaf7ef; }
.xls tr.is-new td:first-child { background: #1d6f42; color: #fff; }
.xls tr.is-new td { animation: cell-in .4s var(--ease-out) backwards; }
.xls tr.is-new td:nth-child(2) { animation-delay: .08s; }
.xls tr.is-new td:nth-child(3) { animation-delay: .16s; }
.xls tr.is-new td:nth-child(4) { animation-delay: .24s; }
.xls tr.is-new td:nth-child(5) { animation-delay: .32s; }
.xls tr.is-new td:nth-child(6) { animation-delay: .4s; }
.xls tr.is-new td:nth-child(7) { animation-delay: .48s; }
@keyframes cell-in { from { color: transparent; background: #fff; } }
.xls tr { transition: opacity .4s; }
.xls tr.is-old { opacity: .55; }

.xls__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
}
.xls__foot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.xls__dl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding-inline: 14px;
  border-radius: 10px;
  background: #1d6f42;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.xls__dl .i { width: 16px; height: 16px; }
.xls__dl.is-ready { animation: dl-pulse 1.2s var(--ease-out); }
@keyframes dl-pulse {
  0% { box-shadow: 0 0 0 0 rgb(29 111 66 / .5); }
  100% { box-shadow: 0 0 0 14px rgb(29 111 66 / 0); }
}

/* ---------- Duyarlı ---------- */
/* Orta genişlikte "KDV %" sütunu gizlenir; oran okunan alanlarda zaten görünüyor */
@media (max-width: 1500px) {
  .xls th:nth-child(5), .xls td:nth-child(5) { display: none; }
}

@media (max-width: 1100px) {
  .app-section__inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  /* Telefon üstte, Excel altta; veri hattı gizlenir */
  .scan { grid-template-columns: 1fr; justify-items: center; gap: 28px; }
  .scan__lines { display: none; }
  .phone-ui { width: 270px; }
  .xls { width: 100%; }
  .xls th:nth-child(4), .xls td:nth-child(4),
  .xls th:nth-child(5), .xls td:nth-child(5) { display: none; }
  .xls td:nth-child(3) { max-width: 110px; }
}

@media (max-width: 480px) {
  .phone-ui__screen { height: 520px; }
  .scan-steps li { padding: 12px; gap: 12px; }
  .xls__foot { flex-wrap: wrap; }
  .xls__title small { display: none; }
}
