html:has(.invoice-dialog[open]),
body:has(.invoice-dialog[open]) {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.invoice-dialog-status[hidden] {
  display: none;
}

.invoice-dialog-status.is-error::before {
  animation: none;
  border-color: #c88173;
}
.invoice-open-button {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 13px;
  margin-top: 12px;
  padding: 13px 15px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(110deg, #fff 0%, #f7fbf8 100%);
  border: 1px solid #dce9e1;
  border-radius: 17px;
  box-shadow: 0 8px 22px rgba(44, 83, 64, .06);
  cursor: pointer;
}

.invoice-open-button:hover {
  border-color: #b7d6c4;
  box-shadow: 0 11px 26px rgba(44, 83, 64, .11);
}

.invoice-open-button:focus-visible {
  outline: 3px solid #72a88b;
  outline-offset: 3px;
}

.invoice-open-button__icon {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  color: #17624d;
  background: transparent;
}

.invoice-open-button__icon img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.invoice-open-button__copy {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.invoice-open-button__copy strong {
  font-size: clamp(19px, 5.4vw, 24px);
  font-weight: 800;
  line-height: 1.2;
}

.invoice-open-button__arrow {
  color: #397361;
}

.invoice-dialog {
  width: min(1040px, calc(100% - 28px));
  height: min(92dvh, 960px);
  max-width: none;
  max-height: 92dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #f2f6f5;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(18, 38, 30, .35);
}
.invoice-dialog[open] { animation: invoice-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
.invoice-dialog::backdrop { background: rgba(17, 31, 25, .6); backdrop-filter: blur(6px); }
.invoice-dialog-shell { display: grid; width: 100%; height: 100%; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.invoice-dialog-header {
  display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 20px; background: #fff; border-bottom: 1px solid #e3ebe7;
}
.invoice-dialog-header span { display: block; margin-bottom: 3px; color: #5c8271; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.invoice-dialog-header h2 { margin: 0; font-family: Bricolage, Geist, sans-serif; font-size: 21px; font-weight: 500; line-height: 1.15; }
.invoice-dialog-close {
  display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; padding: 0;
  color: #34584a; background: #eef4f0; border: 1px solid #dbe7e0; border-radius: 50%; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.invoice-dialog-close:hover { background: #e0ece5; transform: rotate(90deg); }
.invoice-dialog-close:focus-visible { outline: 3px solid #72a88b; outline-offset: 2px; }
.invoice-dialog-close svg { width: 18px; height: 18px; }
.invoice-dialog-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #f2f6f5; }
.invoice-dialog-frame[hidden] { display: none; }
.invoice-dialog-status {
  display: grid; justify-items: center; gap: 10px; margin: 0; padding: 48px 24px;
  color: #526976; font-size: 13px; line-height: 1.5; text-align: center;
}
.invoice-dialog-status::before {
  content: ""; width: 38px; height: 38px; border: 3px solid #d8e6df; border-top-color: #2f9a77;
  border-radius: 50%; animation: invoice-spin .9s linear infinite;
}
@keyframes invoice-spin { to { transform: rotate(360deg); } }
@keyframes invoice-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  /* Mobile: full-height bottom sheet instead of a floating card. */
  .invoice-dialog {
    width: 100%; height: calc(100dvh - 10px); max-height: calc(100dvh - 10px);
    margin: auto 0 0; border: 0; border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(18, 38, 30, .35);
  }
  .invoice-dialog[open] { animation: invoice-sheet .32s cubic-bezier(.2, .8, .2, 1) both; }
  .invoice-dialog-shell::before {
    content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 5px;
    margin-left: -21px; background: #cfdcd6; border-radius: 99px;
  }
  .invoice-dialog-shell { position: relative; }
  .invoice-dialog-header { min-height: 60px; padding: 14px 10px 8px 16px; }
  .invoice-dialog-header h2 { font-size: 19px; }
  .invoice-dialog-close { width: 38px; height: 38px; }
}
@keyframes invoice-sheet { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .invoice-dialog[open], .invoice-dialog-status::before { animation: none; }
  .invoice-dialog-close, .invoice-dialog-close:hover { transition: none; transform: none; }
}

/* Banka sayfasında üstte, ilk görünen e-Arşiv kartı */
.payment-invoice-top { margin: -4px 0 18px; }
.payment-reason-trigger {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 9px auto; padding: 0 13px; border: 1px solid #ead2dc; border-radius: 999px;
  background: #fff8fb; color: #751443; font: inherit; font-size: 13px; font-weight: 650;
  cursor: pointer; transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.payment-reason-trigger:hover { transform: translateY(-1px); border-color: #d6a9bc; background: #fff0f6; }
.payment-reason-trigger:focus-visible { outline: 3px solid #d9a8be; outline-offset: 3px; }
.payment-reason-trigger svg:first-child { width: 17px; height: 17px; }
.payment-reason-trigger svg:last-child { width: 15px; height: 15px; opacity: .7; }
.payment-invoice-top .invoice-open-button {
  margin-top: 0;
  min-height: 82px;
  padding: 14px 16px;
  gap: 14px;
  border-radius: 20px;
  border: 1px solid rgba(23, 98, 77, .22);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(114, 168, 139, .22), transparent 55%),
    linear-gradient(115deg, #ffffff 0%, #eef7f2 100%);
  box-shadow: 0 14px 34px rgba(23, 98, 77, .12), inset 0 1px 0 #fff;
  position: relative;
  overflow: hidden;
}
.payment-invoice-top .invoice-open-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: invoice-sheen 4.5s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes invoice-sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .payment-invoice-top .invoice-open-button::after { animation: none; } }

.payment-reason-dialog {
  width: min(540px, calc(100% - 28px)); max-width: none; max-height: min(86dvh, 720px);
  margin: auto; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px; background: #fffaf7; color: #3e1027;
  box-shadow: 0 28px 90px rgba(52, 21, 38, .3);
}
.payment-reason-dialog::backdrop { background: rgba(48, 25, 46, .56); backdrop-filter: blur(5px); }
.payment-reason-dialog[open] { animation: payment-reason-pop .24s cubic-bezier(.2,.8,.2,1) both; }
.payment-reason-panel { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: min(86dvh, 720px); }
.payment-reason-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 21px 20px 15px; }
.payment-reason-eyebrow { display: block; margin-bottom: 6px; color: #9a5573; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.payment-reason-header h2 { max-width: 410px; margin: 0; color: #53112f; font-family: Bricolage, Geist, sans-serif; font-size: clamp(21px, 5vw, 27px); font-weight: 500; line-height: 1.12; }
.payment-reason-header form,.payment-reason-footer form { margin: 0; }
.payment-reason-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #ead9df; border-radius: 50%; background: #fff; color: #6e2343; cursor: pointer; transition: background-color .18s ease, transform .18s ease; }
.payment-reason-close:hover { transform: rotate(90deg); background: #f8eaf0; }
.payment-reason-close:focus-visible,.payment-reason-confirm:focus-visible { outline: 3px solid #d9a8be; outline-offset: 3px; }
.payment-reason-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 20px 18px; }
.payment-reason-intro { margin: 0 0 15px; color: #695360; font-size: 14px; line-height: 1.55; }
.payment-reason-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.payment-reason-list li { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: start; gap: 12px; padding: 13px; border: 1px solid #f0dfe5; border-radius: 17px; background: #fff; }
.payment-reason-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: #fff0f5; color: #8d164c; font-size: 19px; font-weight: 750; }
.payment-reason-list strong { display: block; margin: 1px 0 4px; color: #571534; font-size: 14px; line-height: 1.3; }
.payment-reason-list p { margin: 0; color: #6d5a63; font-size: 12.5px; line-height: 1.48; }
.payment-reason-closing { margin: 13px 2px 0; color: #7a2850; font-size: 13px; font-weight: 650; line-height: 1.45; text-align: center; }
.payment-reason-footer { display: flex; justify-content: center; padding: 12px 20px 18px; border-top: 1px solid #f0e3e7; background: #fffaf7; }
.payment-reason-confirm { min-width: 180px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 16px; background: #8d164c; color: #fff7ee; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(141,22,76,.18); transition: transform .18s ease, background-color .18s ease; }
.payment-reason-confirm:hover { transform: translateY(-1px); background: #74103d; }
@keyframes payment-reason-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .payment-reason-dialog { width: calc(100% - 24px); max-height: 86dvh; border-radius: 24px; }
  .payment-reason-panel { max-height: 86dvh; }
  .payment-reason-header { padding: 19px 16px 13px; }
  .payment-reason-close { width: 38px; height: 38px; }
  .payment-reason-body { padding: 0 16px 16px; }
  .payment-reason-list li { grid-template-columns: 36px minmax(0,1fr); gap: 10px; padding: 11px; }
  .payment-reason-icon { width: 36px; height: 36px; border-radius: 12px; font-size: 17px; }
  .payment-reason-footer { padding: 11px 16px 16px; }
  .payment-reason-confirm { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .payment-reason-dialog[open] { animation: none; }
  .payment-reason-trigger,.payment-reason-close,.payment-reason-confirm,
  .payment-reason-trigger:hover,.payment-reason-close:hover,.payment-reason-confirm:hover { transition: none; transform: none; }
}
.payment-invoice-top .invoice-open-button__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(23, 98, 77, .14);
}
.payment-invoice-top .invoice-open-button__icon img { width: 44px; height: 44px; }
.payment-invoice-top .invoice-open-button__copy strong { font-size: clamp(18px, 5vw, 22px); letter-spacing: -.01em; color: #103f32; }
.invoice-open-button__hint { font-size: 12.5px; line-height: 1.35; color: #3f6f5e; }
.payment-invoice-top .invoice-open-button__arrow {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2c8a6a, #17624d);
  box-shadow: 0 8px 18px rgba(23, 98, 77, .28);
}
.payment-invoice-top .invoice-open-button__arrow svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .payment-invoice-top .invoice-open-button { min-height: 74px; padding: 12px 13px; gap: 11px; }
  .payment-invoice-top .invoice-open-button__icon { width: 50px; height: 50px; }
  .payment-invoice-top .invoice-open-button__icon img { width: 40px; height: 40px; }
}
