* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body { padding: 0; margin: 0; min-width: 320px; color: var(--text-primary); background: #eff0f3; font-family: var(--font-ui); }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--active); outline-offset: 3px; }
button:disabled { cursor: default; }
body.has-modal { overflow: hidden; }
#app { width: 100%; min-height: 100dvh; }
.mts-pay-logo { display:block; flex:0 0 auto; width:58px; height:24px; }
/* Mobile bottom sheet; tablets and desktop use the centered Figma dialog. */
.modal-root { --modal-backdrop-blur:11px; position:fixed; inset:0; display:flex; align-items:flex-end; justify-content:center; z-index:100; isolation:isolate; }
.modal-backdrop { position:absolute;inset:0; background:rgba(0,0,0,.46);backdrop-filter:blur(var(--modal-backdrop-blur));-webkit-backdrop-filter:blur(var(--modal-backdrop-blur)); animation:backdrop-in 240ms ease-out both; }
.payment-sheet { z-index:2; width:min(100%,440px); height:var(--sheet-content-height, var(--sheet-fallback-height, auto)); max-height:calc(100dvh - 14px); position:relative; display:flex; flex-direction:column; background:var(--surface);border-radius:var(--radius-sheet) var(--radius-sheet) 0 0; overflow:hidden; color:var(--text-primary); box-shadow:0 -5px 24px rgba(0,0,0,.065); transform-origin:50% 100%; animation:sheet-in 320ms cubic-bezier(.22,1,.36,1) both; outline: none; }
.sheet-scroll { position:relative;flex:1 1 auto;min-height:0;overflow-y:auto; overscroll-behavior:contain;scrollbar-width:none; }
.sheet-scroll::-webkit-scrollbar,.methods-scroll::-webkit-scrollbar { display:none; }
.sheet-header { position:absolute;z-index:4;left:0;right:0;top:0;height:60px;display:flex;align-items:flex-start; justify-content:space-between;padding:20px 20px 8px;pointer-events:none;background:linear-gradient(to bottom,#fff 60%,rgba(255,255,255,.87) 79%,rgba(255,255,255,0)); }
.sheet-header > * { pointer-events:auto; }
.sheet-header-row { display:flex;align-items:flex-start;justify-content:space-between;width:100%; }
.sheet-header .mts-pay-logo { margin-top:4px; }
.sheet-close { width:32px;height:32px; border:0;border-radius:12px;display:grid;place-items:center;background:#f2f3f7;color:#1d2023;padding:0; }
.sheet-close:hover { background:#e8eaee; }
.sheet-avatar { width:32px;height:32px; flex:0 0 32px; border:1px solid #fff;border-radius:12px; background:radial-gradient(circle at 66% 30%,#e4e0da 0,#cabfbd 46%,#988a8b 100%);position:relative;overflow:hidden; }
.sheet-avatar .avatar-hair { position:absolute;top:4px;left:8px;width:19px;height:30px;background:#6b443c;border-radius:11px 12px 3px 5px; }
.sheet-avatar .avatar-face { position:absolute;top:8px;left:12px;width:12px;height:16px;border-radius:45% 45% 50% 50%;background:#edbfa5;box-shadow:0 11px 0 6px #8c6874; }
.merchant-block { display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:306px; padding-top:84px;padding-bottom:16px; }
.merchant-picture { width:100px;height:100px;border-radius:32px;flex:0 0 100px;background:#000;display:flex;align-items:center;justify-content:center;margin-bottom:16px;color:#fff; }
.merchant-picture--refill { background:var(--surface-blue); color:var(--dark-green); }
.merchant-picture span { font-family:Georgia,'Times New Roman',serif;font-size:11px;letter-spacing:-.4px;font-weight:400;transform:scaleX(.91); white-space:nowrap; }
.merchant-name { display:flex;align-items:center;justify-content:center;height:24px;line-height:24px;margin:0;color:#031918;font-size:16px;font-weight:500; }
.merchant-amount { display:flex;align-items:center;justify-content:center;height:46px;line-height:40px;margin:0;padding:2px 0 4px 8px;font-family:var(--font-merchant);font-size:32px;font-weight:400;letter-spacing:0;color:#031918;white-space:nowrap; }
.merchant-caption { display:flex;align-items:center;justify-content:center;height:20px;line-height:20px;margin:0;font-size:14px;font-weight:400; }
.methods-scroll { display:flex;gap:12px;padding:20px;overflow-x:auto;scroll-snap-type:x proximity;scroll-padding-inline:20px;overscroll-behavior-x:contain;touch-action:pan-x; }
.choice-card { position:relative; flex:0 0 136px; width:136px;height:94px;display:flex;align-items:center;justify-content:center;border:0;border-radius:22px;background:transparent;padding:2px;overflow:visible;box-shadow:0 0 0 2px var(--stroke);transform-origin:center;transition:transform 240ms cubic-bezier(.22,1,.36,1),box-shadow 150ms ease;scroll-snap-align:center; }
.choice-card.is-selected { box-shadow:0 0 0 2px var(--pay-active); }
.card-face { width:132px;height:90px;border-radius:20px;background:#f2f3f7;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;padding:12px;position:relative; }
.card-face--mts { background:var(--surface-blue); }
.card-face--alfa,.card-face--sbp { background:#f2f3f7; }
.card-top { display:flex;align-items:flex-start;justify-content:space-between;height:21px;position:relative;z-index:1; }
.card-bank-mark { display:inline-grid;place-items:center; width:20px;height:20px;border-radius:7px;font-size:12px;font-weight:800;color:white; }
.card-mts {background:#ff0032;font-family:Georgia,serif;border-radius:6px;}
.card-tbank {background:#ffdd2d;color:white;border-radius:50%;font-size:18px;text-shadow:0 1px 0 #fff;}
.card-alfa {background:#ed2626;border-radius:6px;}
.card-sber {background:linear-gradient(45deg,#098e4a,#43d688);border-radius:50%;}
.mir-mark {font-size:11px;color:#000;font-weight:400;letter-spacing:-.6px; }
.sbp-mark {font-size:9px;color:#6d7683;font-weight:700; }
.mastercard {display:flex;position:relative;width:26px;height:16px;margin-top:1px;}
.mastercard span {width:14px;height:14px;position:absolute;top:1px;border-radius:50%;background:#000;}
.mastercard span+span {left:10px;opacity:.9;}
.card-bottom { display:flex;flex-direction:column;gap:0;text-align:left;line-height:18px;z-index:1; }
.card-bottom strong {font-size:14px;font-weight:500;white-space:nowrap; }
.card-bottom > span {font-size:12px;line-height:16px;white-space:nowrap;letter-spacing:0; }
.sheet-footer { position:relative;flex:0 0 auto; min-height:calc(108px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;align-items:center;gap:12px; padding:8px 20px calc(16px + env(safe-area-inset-bottom,0px)); background:linear-gradient(to bottom,rgba(255,255,255,.91),#fff 28%,#fff);z-index:3; }
.pay-button {height:56px;flex:0 0 56px;width:100%;border:0;border-radius:20px;color:white;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 24px;text-transform:uppercase;font-family:var(--font-wide);font-size:12px;font-weight:700;letter-spacing:0;background:linear-gradient(0deg,#031918 77.985%,#0070e5 151.37%); transform-origin:center;transition:transform 240ms cubic-bezier(.22,1,.36,1),filter 180ms ease; }
/* Press feedback changes visual scale only; carousel layout and outline spacing stay fixed. */
.pay-button:active,.choice-card:active { transform:scale(.97); transition-duration:120ms; }
.pay-button:active { filter:brightness(.92); }
.pay-button:focus-visible {outline-offset:-4px;outline-color:#fff;}
.offer-caption {flex:0 0 16px; margin:0;font-size:12px;line-height:16px;color:#626c77;white-space:nowrap;text-align:center; }
.offer-caption button {border:0;background:transparent;color:inherit;text-decoration:underline;padding:0;font-size:inherit;cursor:pointer;}
.is-closing .modal-backdrop {animation:backdrop-out 260ms ease-in both;}
.is-closing .payment-sheet {animation:sheet-out 240ms cubic-bezier(.4,0,1,1) both;}
.is-instant:not(.is-closing) :is(.modal-backdrop,.payment-sheet) { animation: none; }
@keyframes backdrop-in {from{opacity:0;backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0)}to{opacity:1;backdrop-filter:blur(var(--modal-backdrop-blur));-webkit-backdrop-filter:blur(var(--modal-backdrop-blur))}}
@keyframes backdrop-out {from{opacity:1}to{opacity:0}}
@keyframes sheet-in {from{transform:translateY(100%)}to{transform:translateY(0)}}
@keyframes sheet-out {from{transform:translateY(0)}to{transform:translateY(100%)}}
@keyframes dialog-in {from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes dialog-out {from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(16px)}}
.toast { position:fixed;z-index:200;left:50%;bottom:calc(22px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:max-content;max-width:min(90vw,460px);border-radius:15px;background:rgba(22,24,29,.96);color:white;box-shadow:0 10px 35px #0003;padding:13px 17px;font-size:13px;text-align:center;animation:toast-in .2s ease both; }
@keyframes toast-in {from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
@media (max-width:380px) { .checkout-intro {font-size:15px;white-space:normal;} .option-detail {font-size:11px;} .gift-option .gift-detail {font-size:13px;} }
@media (max-width:599px) and (max-height:620px) {
  .payment-sheet:not([data-flex-variant]) { --sheet-fallback-height:100dvh; max-height:calc(100dvh - 8px); }
  .merchant-block { min-height:270px;padding-top:64px; }
  .merchant-picture { height:84px;width:84px;flex-basis:84px;border-radius:28px; }
}
@media (min-width:600px) {
  .modal-root { --modal-backdrop-blur:50px; align-items:center;padding:24px; }
  .modal-backdrop { background:rgba(29,32,35,.4); }
  .payment-sheet { width:440px;max-width:100%;max-height:calc(100dvh - 48px);border-radius:var(--radius-sheet);box-shadow:none;transform-origin:center;animation-name:dialog-in; }
  .sheet-footer { min-height:108px;padding:8px 20px 16px; }
  .is-closing .payment-sheet { animation-name:dialog-out; }
}
@media (prefers-reduced-motion:reduce) { .pay-button,.choice-card {transition:none;} .pay-button:active,.choice-card:active {transform:none;} .modal-backdrop,.payment-sheet,.toast,.is-closing .modal-backdrop,.is-closing .payment-sheet {animation-duration:.01ms!important;transition:none!important;} }

/* Original Figma assets; SVGs retain their exported intrinsic dimensions. */
.payment-sheet { font-synthesis:none; }
.sheet-avatar { object-fit:cover; }
.merchant-picture { object-fit:cover; }
.card-system { display:flex;align-items:center;justify-content:flex-end;height:20px; }
.card-system img { display:block; }
.card-bank-asset { display:block;flex:none; }
.card-skin { position:absolute;pointer-events:none; }
/* Figma export already contains 40% alpha and progressive blur.
   Only the 20px radius on .card-face clips this square texture. */
.card-skin--mts { inset:0;width:132px;height:90px;border-radius:0; }
.card-skin--bank { left:-58px;top:-58px;width:160px;height:160px; }
.card-skin--bank img { display:block;transform:scale(5);transform-origin:0 0; }
.card-single-label { font-size:14px!important;line-height:18px!important; }

.card-badge { position:absolute;left:50%;top:-16px;transform:translateX(-50%);border-radius:6px;width:93px;height:16px;padding:0 4px;text-align:center;background:var(--stroke);color:var(--text-primary);font-size:12px;font-weight:500;line-height:16px;white-space:nowrap; }
.is-selected .card-badge { background:var(--pay-active);color:#fafafa; }
.merchant-name,.merchant-amount-value,.price-roll-character { background:linear-gradient(0deg,#031918 77.985%,#2b7d78 151.37%);background-clip:text;-webkit-background-clip:text;color:transparent; }

.merchant-amount { position: relative; align-self: stretch; }
.merchant-amount-value, .price-roll-character { background-size: 100% 46px; background-position: 0 -2px; }

.price-roll {
  position: absolute;
  inset: 2px 0 4px;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.price-roll-character { position: absolute; top: 0; }
.price-roll + .merchant-amount-value { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .price-roll { display: none; }
  .price-roll + .merchant-amount-value { opacity: 1; }
}

/* Flex keeps its Figma height when there is room, with a scrollable body on short screens. */
.payment-sheet[data-flex-variant] { --flex-positive: #26cd58; }
.payment-sheet[data-flex-variant] .sheet-header { position: sticky; display: block; height: auto; }
.payment-sheet[data-flex-variant] .merchant-block { min-height: 0; padding: 24px 0 16px; }
.payment-sheet [hidden] { display: none; }

/* Let the content and the sheet grow together while respecting the viewport cap. */
.sheet-disclosure {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 320ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease;
}

.sheet-disclosure:not([inert]) { grid-template-rows: 1fr; opacity: 1; }
.sheet-disclosure-clip { min-height: 0; overflow: hidden; }

@starting-style {
  .sheet-disclosure:not([inert]) { grid-template-rows: 0fr; opacity: 0; }
}

.flex-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 28px;
  margin-top: 20px;
}

.flex-tab {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font: 900 20px/24px 'MTS Sans Web', var(--font-ui);
  letter-spacing: -.4px;
  white-space: nowrap;
}

.flex-tab-label { display: flex; flex-direction: column; align-items: center; }
.flex-tab-underline { visibility: hidden; transform: rotate(-2deg); }
.flex-tab[aria-selected="true"] { color: var(--text-primary); }
.flex-tab[aria-selected="true"] .flex-tab-underline { visibility: visible; }

.flex-details-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.flex-details-button img { transition: transform 320ms cubic-bezier(.2,.8,.2,1); }
.flex-details-button[aria-expanded="true"] img { transform: rotate(90deg); }
.flex-details { margin: 0 20px; padding: 16px 0; border-radius: 20px; background: var(--surface-soft); }

.flex-toggle {
  position: relative;
  margin-inline: 20px;
  padding-block: 16px;
  border-radius: 32px;
  background: var(--surface-soft);
}

.flex-pointer { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); }

.flex-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.flex-emblem { flex: none; position: relative; overflow: hidden; border-radius: 12px; }
.flex-emblem img { display: block; }
.flex-emblem::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--stroke); pointer-events: none; }
.flex-toggle--detailed .flex-emblem { border-radius: 16px; }
.flex-toggle-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.flex-toggle-title { font-size: 14px; line-height: 20px; font-weight: 500; }
.flex-toggle-terms { color: var(--text-secondary); font-size: 12px; line-height: 16px; }
.flex-toggle--detailed .flex-toggle-title { font-size: 17px; }
.flex-toggle--detailed .flex-toggle-terms { font-size: 14px; line-height: 20px; }

.flex-switch-track {
  position: relative;
  flex: 0 0 42px;
  height: 24px;
  overflow: hidden;
  border-radius: 100px;
  background: var(--stroke);
  transition: background-color 150ms ease;
}

.flex-switch-track::after {
  content: '';
  position: absolute;
  inset: 3px auto auto 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 16px #0001, 0 4px 16px #0001;
  transition: transform 150ms ease;
}

.flex-toggle-row[aria-checked="true"] .flex-switch-track { background: var(--flex-positive); }
.flex-toggle-row[aria-checked="true"] .flex-switch-track::after { transform: translateX(18px); }

.flex-schedule {
  display: grid;
  grid-template-columns: minmax(0, .5fr) minmax(0, 1fr);
  gap: 4px;
  padding-inline: 16px;
  font-size: 12px;
  line-height: 16px;
}

.flex-toggle .flex-schedule { margin-top: 10px; }
.flex-schedule p { margin: 0; }
.flex-schedule p + p { color: var(--text-secondary); }
.flex-schedule p::before {
  content: '';
  display: block;
  height: 4px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--pay-active);
}
.flex-schedule p + p::before { background: #c6ccd7; }
[data-flex-active="true"] .flex-schedule p:first-child::before { background: var(--flex-positive); }

@media (prefers-reduced-motion: reduce) {
  .sheet-disclosure, .flex-details-button img, .flex-switch-track, .flex-switch-track::after { transition: none; }
}
