/* SIMBA Online Recharge — replica of topup.simba.sg */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--page-bg);
  color: #212529;
  font-size: 14px;
  overflow-x: clip;
}

/* ── Page wrapper ── */
.page-wrap {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(2px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

/* ── Шапка: белая строка лого + серая строка заголовка = фон страницы ── */
.brand {
  text-align: center;
  padding: 2px 0 0;
  width: 100%;
}

/* Верхняя полоса: SIMBA на белом (отличается от фона страницы #f0f0f2) */
.brand-logo-wrap {
  margin: 0 -12px 0;
  width: calc(100% + 24px);
  background: #ffffff;
  padding: 11px 12px 12px;
  text-align: center;
  line-height: 0;
}

.brand-logo {
  width: clamp(132px, 30vw, 198px);
  height: auto;
  display: inline-block;
  vertical-align: top;
}

/* Нижняя полоса: тот же серый, что фон страницы */
.brand-sub-bar {
  margin: 0 -12px 0;
  width: calc(100% + 24px);
  background: var(--page-bg);
  padding: 11px 12px;
}

/* h4: заголовок «SIMBA Online Recharge» — крупнее */
.brand-page-title {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 700;
  color: #000;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ── Width: wide form + banner aligned below ── */
:root {
  --page-bg: #f0f0f2;
  --content-max: min(98vw, 1020px);
  /* Amount tiles: very light gray (reference topup.simba.sg) */
  --amount-bg: #f4f5f7;
  --amount-border: #e0e3e8;
  --amount-hover: #eceef2;
  --amount-checked: #e8e0f0;
  --amount-checked-border: #4a2c7a;
  --simba-purple: #53006a;
  --simba-purple-dark: #420055;
}

/* ── White card ── */
.card {
  background: #fff;
  border-radius: 1.25rem;
  width: 100%;
  max-width: var(--content-max);
  margin-top: 12px;
  padding: 42px 40px 56px;
  min-height: clamp(540px, 76vh, 920px);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* ── Number field (narrower than amount grid) ── */
.field-wrap {
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  background: #f4f5f6;
  overflow: hidden;
  margin: 0 auto 8px;
  max-width: min(420px, 70%);
}

.field {
  display: block;
  width: 100%;
  padding: 22px 28px;
  min-height: 64px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 1.35rem;
  color: #495057;
}

.field::placeholder { color: #6c757d; }
.field:focus { outline: none; }

/* ── Amount grid ── */
.amount-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 22px -6px 0;
}

.amount-cell {
  width: 33.333%;
  padding: 10px 6px;
}

.amount-cell-idd {
  width: 66.666%;
}

.amount-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.amount-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  padding: 14px 12px;
  min-height: 52px;
  background: var(--amount-bg);
  color: #212529;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid var(--amount-border);
  border-radius: 15px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.amount-cell-idd .amount-btn {
  width: 100%;
  font-size: 0.95rem;
}

.amount-btn:hover {
  background: var(--amount-hover);
  border-color: #d4d8de;
}

.amount-input:checked + .amount-btn {
  background: var(--simba-purple);
  color: #fff;
  border-color: var(--simba-purple);
  box-shadow: 0 2px 8px rgba(74, 44, 122, 0.35);
}

/* ── Next button ── */
.next-row {
  text-align: center;
  margin-top: 36px;
}

.btn-next {
  display: inline-block;
  padding: 12px 42px;
  border: 1px solid #c5cad1;
  border-radius: 50rem;
  background: #fff;
  color: #212529;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s;
}

.btn-next:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

/* ── Terms ── */
.terms {
  margin-top: 40px;
  text-align: center;
}

.terms p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: #6c757d;
}

.terms a { color: #0d6efd; }

.legal-note {
  margin-top: 12px !important;
  font-size: 10px !important;
  color: #868e96 !important;
}

.legal-note code {
  font-size: 0.95em;
}

/* ── Broadband promo (inside white card) ── */
.banner {
  width: 100%;
  margin-top: 28px;
}

.banner-link {
  display: block;
  line-height: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.banner-img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  display: block;
  border: 1px solid #1a1a1a;
  box-sizing: border-box;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Phones & narrow viewports ── */
@media (max-width: 599.98px) {
  .page-wrap {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  /* Шапка edge-to-edge с учётом safe-area страницы */
  .brand-logo-wrap,
  .brand-sub-bar {
    margin-left: calc(-1 * max(10px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(10px, env(safe-area-inset-right)));
    width: calc(
      100%
      + max(10px, env(safe-area-inset-left))
      + max(10px, env(safe-area-inset-right))
    );
  }

  .card {
    padding: 22px 14px 32px;
    min-height: 0;
    border-radius: 1rem;
  }

  .field-wrap {
    max-width: 100%;
  }

  .field {
    padding: 14px 12px;
    min-height: 52px;
    font-size: 16px; /* iOS: меньше 16px включают зум поля при фокусе */
  }

  .amount-grid {
    margin: 18px -4px 0;
  }

  .amount-cell {
    padding: 8px 4px;
  }

  .amount-btn {
    min-height: 48px;
    padding: 12px 6px;
    font-size: 0.9375rem;
  }

  .amount-cell-idd .amount-btn {
    font-size: 0.8rem;
    line-height: 1.25;
    padding-inline: 6px;
  }

  .next-row {
    margin-top: 28px;
  }

  .btn-next {
    padding: 14px 24px;
    width: min(100%, 300px);
  }

  .terms {
    margin-top: 28px;
  }

  .terms p {
    font-size: max(11px, 3.1vw);
  }

  .banner {
    margin-top: 22px;
  }

  .banner-img {
    border-radius: 11px;
  }

  .brand-page-title {
    font-size: clamp(1.2rem, 5.8vw, 1.85rem);
  }
}

.brand-home-link {
  color: inherit;
  text-decoration: none;
}

.brand-home-link:hover {
  text-decoration: underline;
}

.terms-links {
  margin-top: 12px !important;
  font-size: 12px !important;
}

.terms-links a {
  color: #212529;
  font-weight: 600;
}

.page-wrap--legal {
  padding-bottom: 0;
}

#site-chrome-mount {
  width: 100%;
  max-width: var(--content-max);
  margin-top: 8px;
}

/* ── Site footer (Google Ads / legal links) ── */
.site-footer {
  width: 100%;
  margin-top: 20px;
  background: #e8e9ec;
  color: #444;
  font-size: 13px;
  border-radius: 12px;
  overflow: hidden;
}

.site-footer__main {
  padding: 22px 16px 18px;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.site-footer__heading {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
}

.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__col li {
  margin-bottom: 6px;
}

.site-footer__col a {
  color: #444;
  text-decoration: none;
}

.site-footer__col a:hover {
  color: #000;
  text-decoration: underline;
}

.site-footer__disclosure--full {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #d0d2d6;
  font-size: 12px;
  line-height: 1.55;
  color: #555;
  max-width: 100%;
  text-align: left;
}

.site-footer__disclosure--full p {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.site-footer__disclosure--full p:last-child {
  margin-bottom: 0;
}

.site-footer__disclosure-title {
  margin: 0 0 8px !important;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

.site-footer__disclosure--full a {
  color: #212529;
  font-weight: 600;
  word-break: break-word;
}

.site-footer__bar {
  background: #3a3a3a;
  color: #bbb;
  font-size: 11px;
  padding: 10px 16px;
}

.site-footer__bar-inner {
  text-align: center;
}

.legal-page-wrap {
  width: 100%;
  max-width: var(--content-max);
  padding: 8px 0 0;
}

.legal-page {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 32px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.legal-page h1 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.legal-page p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #555;
}

.legal-page a {
  color: #212529;
  font-weight: 600;
}

/* ── Service note ── */
.service-note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #c0392b;
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Confirm modal (step 1) ── */
.simba-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.simba-modal.is-open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.simba-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.simba-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.simba-modal__line {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #333;
}

.simba-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.btn-modal-back,
.btn-modal-confirm {
  min-width: 120px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-modal-back {
  border: 1px solid #adb5bd;
  background: #fff;
  color: #212529;
}

.btn-modal-confirm {
  border: 0;
  background: var(--simba-purple);
  color: #fff;
}

.btn-modal-confirm:hover {
  background: var(--simba-purple-dark);
}

/* ── Payment page (step 2) ── */
.card--payment {
  min-height: auto;
  padding: 40px 28px 32px;
  text-align: center;
}

.pay-summary {
  margin: 0 0 12px;
  font-size: 16px;
  color: #333;
  letter-spacing: normal;
  word-spacing: normal;
}

.pay-summary strong {
  font-weight: 700;
  color: #212529;
  letter-spacing: 0;
  word-spacing: normal;
  font-variant-numeric: normal;
  font-kerning: auto;
}

.pay-gateway-note {
  margin: 0 0 20px;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
}

.pay-by-card {
  max-width: 400px;
  margin: 0 auto 24px;
  padding: 20px 16px 18px;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  background: #fafbfc;
  text-align: center;
}

.pay-by-card__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pay-by-card__icon {
  display: flex;
  flex-shrink: 0;
}

.pay-by-card__label {
  font-size: 16px;
  font-weight: 700;
  color: #212529;
}

.pay-by-card__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.card-logo-img {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 88px;
  width: 88px;
  height: 48px;
  padding: 8px 10px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: #fff;
}

.card-logo-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 28px;
  object-fit: contain;
}

.pay-actions--single {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.btn-pay-primary {
  border: 0;
  background: var(--simba-purple);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-pay-primary--large {
  min-width: min(100%, 280px);
  padding: 14px 36px;
  font-size: 16px;
}

.btn-pay-primary:hover {
  background: var(--simba-purple-dark);
}

.pay-back-wrap {
  margin: 0;
}

.btn-pay-link {
  border: 0;
  background: transparent;
  color: #495057;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
}

@media (max-width: 599.98px) {
  .simba-modal__dialog {
    padding: 22px 18px 18px;
  }

  .simba-modal__actions {
    flex-direction: column;
  }

  .btn-modal-back,
  .btn-modal-confirm {
    width: 100%;
  }

  .btn-pay-primary--large {
    width: 100%;
  }
}

@media (max-width: 720px) {
  #site-chrome-mount {
    margin-top: 12px;
    width: 100%;
    max-width: none;
  }

  .site-footer {
    margin-top: 16px;
    border-radius: 10px;
  }

  .site-footer__main {
    padding: 18px 14px 14px;
  }

  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .site-footer__heading {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }

  .site-footer__col a {
    display: inline-block;
    padding: 2px 0;
    min-height: 28px;
    line-height: 1.4;
  }

  .site-footer__disclosure--full {
    font-size: 11px;
    line-height: 1.5;
    padding-top: 12px;
  }

  .site-footer__disclosure-title {
    font-size: 12px;
  }

  .site-footer__bar {
    padding: 10px 12px;
    font-size: 10px;
  }

  .site-footer__bar-inner {
    line-height: 1.45;
  }
}

@media (max-width: 599.98px) {
  #site-chrome-mount {
    margin-left: calc(-1 * max(10px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(10px, env(safe-area-inset-right)));
    width: calc(
      100%
      + max(10px, env(safe-area-inset-left))
      + max(10px, env(safe-area-inset-right))
    );
  }

  .site-footer {
    border-radius: 0;
  }
}
