@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --bg: #eef3ff;
  --bg-top: #fafcff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --text: #122444;
  --muted: #66738d;
  --line: rgba(18, 36, 68, 0.1);
  --primary: #2458e6;
  --primary-soft: rgba(36, 88, 230, 0.12);
  --amber: #efb234;
  --amber-soft: rgba(239, 178, 52, 0.18);
  --emerald: #119a72;
  --emerald-soft: rgba(17, 154, 114, 0.12);
  --danger: #d4557f;
  --danger-soft: rgba(212, 85, 127, 0.14);
  --header-bg: rgba(255, 255, 255, 0.84);
  --brand-shell: #ffffff;
  --ghost-bg: rgba(255, 255, 255, 0.88);
  --ghost-line: rgba(18, 36, 68, 0.12);
  --shadow-lg: 0 28px 72px rgba(18, 36, 68, 0.16);
  --shadow-md: 0 18px 38px rgba(18, 36, 68, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: min(1180px, calc(100% - 16px));
}

html[data-theme="dark"] {
  --bg: #08111f;
  --bg-top: #0b1424;
  --surface: rgba(15, 26, 44, 0.94);
  --surface-strong: #111d31;
  --text: #eef4ff;
  --muted: #aab8cc;
  --line: rgba(188, 210, 243, 0.14);
  --primary: #79a8ff;
  --primary-soft: rgba(121, 168, 255, 0.18);
  --amber: #f1be68;
  --amber-soft: rgba(241, 190, 104, 0.18);
  --emerald: #52c9a2;
  --emerald-soft: rgba(82, 201, 162, 0.16);
  --danger: #f08fae;
  --danger-soft: rgba(240, 143, 174, 0.18);
  --header-bg: rgba(8, 17, 31, 0.84);
  --brand-shell: rgba(255, 255, 255, 0.06);
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-line: rgba(188, 210, 243, 0.14);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 18px 38px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 88, 230, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(239, 178, 52, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 88, 230, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 88, 230, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 92%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.payment-header .container {
  width: min(84%, 1320px);
}

.payment-shell {
  min-height: 100vh;
  position: relative;
}

.payment-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(18, 36, 68, 0.08);
  backdrop-filter: blur(18px);
}

.header-inner,
.header-actions,
.hero-pills,
.panel-head,
.merchant-strip,
.merchant-profile,
.merchant-badges,
.gateway-methods,
.gateway-screen-top,
.app-pills,
.support-grid,
.action-row,
.summary-price,
.learner-header {
  display: flex;
  align-items: center;
}

.header-inner {
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--brand-shell);
  box-shadow: 0 14px 28px rgba(18, 36, 68, 0.14);
}

.brand-mark img {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.brand-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.header-actions {
  gap: 12px;
}

.solid-btn,
.ghost-btn,
.method-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 700;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.solid-btn:focus-visible,
.ghost-btn:focus-visible,
.method-chip:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 88, 230, 0.28);
  outline-offset: 3px;
}

.solid-btn {
  background: linear-gradient(135deg, var(--primary), #5b86ff);
  color: #fff;
  box-shadow: 0 16px 28px rgba(36, 88, 230, 0.24);
}

.ghost-btn {
  background: var(--ghost-bg);
  color: var(--text);
  border: 1px solid var(--ghost-line);
}

.method-chip {
  min-height: 42px;
  background: rgba(18, 36, 68, 0.05);
  color: var(--muted);
  border: 1px solid rgba(18, 36, 68, 0.08);
  box-shadow: none;
}

.method-chip.is-active {
  background: rgba(36, 88, 230, 0.12);
  border-color: rgba(36, 88, 230, 0.18);
  color: var(--primary);
}

.solid-btn:hover,
.ghost-btn:hover,
.method-chip:hover {
  transform: translateY(-2px);
}

.gateway-panel,
.summary-card,
.status-card,
.steps-card,
.support-card,
.payment-success,
.gateway-screen {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

.gateway-panel:hover,
.summary-card:hover,
.status-card:hover,
.steps-card:hover,
.support-card:hover,
.payment-success:hover,
.gateway-screen:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 44px rgba(18, 36, 68, 0.14);
}

.solid-btn:disabled,
.ghost-btn:disabled,
.method-chip:disabled {
  opacity: 0.72;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

.payment-main {
  padding: 36px 0 72px;
}

.payment-hero,
.payment-grid {
  position: relative;
  z-index: 1;
}

.payment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.76fr);
  gap: 22px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(239, 178, 52, 0.24), transparent 28%),
    linear-gradient(145deg, rgba(13, 28, 54, 0.98), rgba(24, 50, 98, 0.96));
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(255, 255, 255, 0.42);
}

.eyebrow-dark {
  color: var(--muted);
}

.eyebrow-dark::before {
  background: rgba(18, 36, 68, 0.18);
}

.hero-copy h1,
.panel-head h2,
.summary-card h2 {
  margin: 14px 0 10px;
  line-height: 1.08;
}

.hero-copy h1 {
  max-width: 14ch;
  font-size: clamp(1.9rem, 3vw, 3rem);
  font-weight: 700;
}

.hero-copy p,
.hero-security li,
.summary-card p,
.status-card p,
.success-copy p {
  line-height: 1.7;
}

.hero-copy p {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.82);
}

.hero-pills {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-pills span,
.merchant-badges span,
.app-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
}

.hero-pills span {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-security,
.gateway-panel,
.summary-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.hero-security {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.hero-security strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.hero-security ul,
.steps-list {
  margin: 0;
  padding-left: 18px;
}

.hero-security li,
.steps-list li {
  margin-bottom: 10px;
}

.payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
  gap: 24px;
  margin-top: 24px;
}

.gateway-panel,
.summary-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h2 {
  font-size: clamp(1.32rem, 1.8vw, 1.72rem);
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(36, 88, 230, 0.1);
  color: var(--primary);
}

.status-chip.is-pending,
.status-chip.is-checking {
  background: rgba(36, 88, 230, 0.1);
  color: var(--primary);
}

.status-chip.is-success {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.status-chip.is-expired {
  background: var(--danger-soft);
  color: var(--danger);
}

.merchant-strip {
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(18, 36, 68, 0.03);
  border: 1px solid rgba(18, 36, 68, 0.08);
}

.merchant-profile {
  gap: 14px;
}

.merchant-avatar,
.learner-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  box-shadow: 0 12px 26px rgba(18, 36, 68, 0.12);
}

.merchant-avatar img,
.learner-avatar img {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: contain;
}

.merchant-profile strong,
.merchant-profile span {
  display: block;
}

.merchant-profile span {
  margin-top: 4px;
  color: var(--muted);
}

.merchant-badges,
.gateway-methods,
.app-pills {
  flex-wrap: wrap;
  gap: 10px;
}

.merchant-badges span,
.app-pills span {
  min-height: 34px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(18, 36, 68, 0.08);
}

.gateway-methods {
  margin: 20px 0;
}

.gateway-methods .method-chip {
  flex: 1 1 140px;
}

.gateway-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.gateway-screen,
.status-card,
.steps-card,
.support-card,
.payment-success {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid rgba(18, 36, 68, 0.08);
}

.gateway-screen {
  background:
    radial-gradient(circle at top right, rgba(36, 88, 230, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.gateway-screen-top,
.summary-price,
.action-row {
  justify-content: space-between;
  gap: 14px;
}

.screen-label,
.summary-grid span,
.learner-grid span,
.support-grid span,
.success-grid span,
.milestone-list span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.gateway-screen-top strong,
.gateway-info-grid strong,
.gateway-meta-grid strong,
.support-grid strong,
.summary-grid strong,
.learner-grid strong,
.summary-price strong,
.success-grid strong {
  display: block;
  margin-top: 6px;
}

.gateway-screen-top strong {
  font-size: 1.48rem;
  font-weight: 700;
}

.expiry-card {
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(18, 36, 68, 0.04);
  border: 1px solid rgba(18, 36, 68, 0.08);
  text-align: right;
}

.gateway-info-grid,
.gateway-meta-grid,
.summary-grid,
.learner-grid,
.support-grid,
.success-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gateway-info-grid,
.gateway-meta-grid {
  margin-top: 20px;
}

.gateway-info-grid > div,
.gateway-meta-grid > div,
.summary-grid > div,
.learner-grid > div,
.support-grid > div,
.success-grid > div {
  padding: 16px;
  border-radius: 16px;
  background: rgba(18, 36, 68, 0.03);
  border: 1px solid rgba(18, 36, 68, 0.06);
}

.qr-stage {
  display: grid;
  place-items: center;
  margin: 22px 0 0;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(36, 88, 230, 0.06), rgba(255, 255, 255, 0.9)),
    #fff;
  border: 1px solid rgba(18, 36, 68, 0.08);
}

.qr-stage img {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1;
  object-fit: contain;
}

.gateway-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.status-card {
  background:
    linear-gradient(180deg, rgba(36, 88, 230, 0.08), rgba(255, 255, 255, 0.96)),
    #fff;
}

.status-card.is-checking {
  background:
    linear-gradient(180deg, rgba(36, 88, 230, 0.14), rgba(255, 255, 255, 0.96)),
    #fff;
}

.status-card.is-success {
  background:
    linear-gradient(180deg, rgba(17, 154, 114, 0.12), rgba(255, 255, 255, 0.96)),
    #fff;
}

.status-card.is-expired {
  background:
    linear-gradient(180deg, rgba(212, 85, 127, 0.12), rgba(255, 255, 255, 0.96)),
    #fff;
}

.status-label,
.success-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-label {
  background: rgba(36, 88, 230, 0.1);
  color: var(--primary);
}

.status-card h3,
.payment-success h3 {
  margin: 16px 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
}

.steps-card strong,
.support-card strong,
.summary-card .eyebrow + h2,
.milestone-list article strong {
  display: block;
}

.support-grid {
  margin-top: 16px;
}

.action-row {
  flex-wrap: wrap;
}

.action-row > * {
  flex: 1 1 180px;
}

.payment-success {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  background:
    linear-gradient(180deg, rgba(17, 154, 114, 0.12), rgba(255, 255, 255, 0.98)),
    #fff;
}

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--emerald);
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
}

.success-kicker {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.summary-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.summary-card p {
  margin: 14px 0 0;
  color: var(--muted);
}

.summary-price {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(18, 36, 68, 0.03);
  border: 1px solid rgba(18, 36, 68, 0.08);
}

.summary-price span {
  color: var(--muted);
  text-decoration: line-through;
}

.summary-price strong {
  margin-top: 0;
  font-size: 1.34rem;
  font-weight: 700;
}

.summary-grid,
.learner-grid {
  margin-top: 18px;
}

.learner-header {
  gap: 14px;
  margin-top: 16px;
}

.learner-header strong,
.learner-header span {
  display: block;
}

.learner-header span {
  margin-top: 4px;
  color: var(--muted);
}

.milestone-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.milestone-list article {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(18, 36, 68, 0.03);
  border: 1px solid rgba(18, 36, 68, 0.06);
}

.milestone-list article strong {
  margin-bottom: 6px;
}

html[data-theme="dark"] .gateway-panel,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .status-card,
html[data-theme="dark"] .steps-card,
html[data-theme="dark"] .support-card,
html[data-theme="dark"] .gateway-screen,
html[data-theme="dark"] .summary-price,
html[data-theme="dark"] .gateway-info-grid > div,
html[data-theme="dark"] .gateway-meta-grid > div,
html[data-theme="dark"] .milestone-list article {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .gateway-methods,
html[data-theme="dark"] .merchant-strip,
html[data-theme="dark"] .expiry-card,
html[data-theme="dark"] .app-pills span,
html[data-theme="dark"] .hero-pills span,
html[data-theme="dark"] .merchant-badges span,
html[data-theme="dark"] .status-label,
html[data-theme="dark"] .method-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(18, 36, 68, 0.92);
  color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .payment-hero,
  .payment-grid,
  .gateway-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .payment-header .container {
    width: var(--container);
  }

  .header-inner {
    min-height: auto;
    padding: 18px 0;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions > * {
    flex: 1 1 180px;
  }

  .gateway-info-grid,
  .gateway-meta-grid,
  .summary-grid,
  .learner-grid,
  .support-grid,
  .success-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .payment-main {
    padding-top: 24px;
  }

  .payment-hero,
  .gateway-panel,
  .summary-card {
    padding: 22px;
  }

  .hero-pills,
  .merchant-badges,
  .app-pills,
  .gateway-methods,
  .action-row {
    gap: 10px;
  }

  .gateway-info-grid,
  .gateway-meta-grid,
  .summary-grid,
  .learner-grid,
  .support-grid,
  .success-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .merchant-strip,
  .gateway-screen-top,
  .summary-price {
    flex-direction: column;
    align-items: flex-start;
  }

  .expiry-card {
    width: 100%;
    text-align: left;
  }

  .action-row > * {
    flex-basis: 100%;
  }

  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}
