:root {
  --bg: #f5efe5;
  --panel: #ffffff;
  --panel-soft: #fbfbfd;
  --line: #e5e8ef;
  --line-strong: #d9dee8;
  --text: #0f172a;
  --muted: #8b95a7;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --success: #45d2a5;
  --success-soft: #eafbf4;
  --info: #2647a5;
  --warn: #f4b339;
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at right center, rgba(183, 121, 31, 0.12), transparent 20%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 45%, #f1e7da 100%);
}

button,
input,
textarea {
  font: inherit;
}

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

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: -60px;
  right: -80px;
  background: rgba(15, 118, 110, 0.12);
}

.orb-b {
  width: 340px;
  height: 340px;
  bottom: -120px;
  left: -80px;
  background: rgba(183, 121, 31, 0.14);
}

.payment-main {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 2.75rem 1.5rem 3rem;
}

.language-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.language-switcher {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 222, 232, 0.95);
  box-shadow: var(--shadow-soft);
}

.language-switcher-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.language-switcher-btn.is-active {
  background: #101721;
  color: #fff;
}

.payment-container {
  width: min(100%, 760px);
}

.payment-page-header {
  display: grid;
  justify-items: center;
  gap: 1.4rem;
  margin-bottom: 1rem;
}

.fincen-logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.fincen-logo-image {
  width: min(100%, 320px);
  height: auto;
  display: block;
}

.submission-success {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(69, 210, 165, 0.26);
  background: linear-gradient(135deg, rgba(69, 210, 165, 0.12), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow-soft);
}

.submission-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #43c698, #4fe0b1);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.submission-success strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.submission-success p {
  margin: 0;
  color: #45615e;
}

.payment-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(217, 222, 232, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

.payment-card+.payment-card {
  margin-top: 1.2rem;
}

.payment-method-card {
  margin-top: 1.2rem;
  transition: opacity 280ms ease, transform 280ms ease, max-height 360ms ease, margin 280ms ease, padding 280ms ease;
  transform-origin: top center;
}

.payment-method-card.is-collapsing {
  pointer-events: none;
}

.payment-method-card.is-hidden {
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  border-color: transparent;
  box-shadow: none;
}

.payment-method-label {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.payment-method-content {
  transition: opacity 220ms ease, transform 220ms ease;
}

.payment-method-content.is-hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.payment-method-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem;
  border-radius: 20px;
  border: 1.5px solid #0fa695;
  background: rgba(129, 255, 90, 0.08);
  text-align: left;
}

.payment-method-icon,
.payment-method-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.payment-method-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4AD6A7, #0fa695);
  color: #fff;
}

.payment-method-icon svg,
.payment-method-check svg {
  width: 20px;
  height: 20px;
}

.payment-method-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.payment-method-check {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #202020;
  box-shadow: 0 6px 18px rgba(255, 90, 90, 0.16);
}

.continue-btn {
  width: 100%;
  margin-top: 1.3rem;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.2rem;
  background: #202020;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.continue-btn:hover,
.continue-btn:focus {
  background: #202020;
}

.payment-method-loader {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: 1rem 0 0.2rem;
  text-align: center;
}

.payment-method-loader strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.payment-method-loader p {
  margin: 0;
  color: var(--muted);
}

.loader-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(15, 166, 149, 0.18);
  border-top-color: #0fa695;
  animation: loaderSpin 0.85s linear infinite;
}

.payment-reveal {
  margin-top: 1.2rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(26px);
  transition: opacity 320ms ease, transform 320ms ease, max-height 420ms ease;
}

.payment-reveal.is-visible {
  opacity: 1;
  max-height: 4000px;
  transform: translateY(0);
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

.payment-summary-card {
  padding-top: 2.2rem;
}

.payment-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  border: 8px solid #f2f6f7;
  color: #fff;
  font-weight: 800;
  background-image: linear-gradient(135deg, #4fe0b1, #43c698);
  box-shadow: 0 8px 18px rgba(69, 210, 165, 0.18);
}

.payment-title {
  margin: 0 0 2rem;
  font-size: 1.85rem;
  font-weight: 800;
  text-align: center;
}

.summary-topline,
.bank-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-topline h2,
.bank-title-row h2,
.invoice-content h3 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
}

.invoice-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.action-btn:hover,
.action-btn:focus {
  color: var(--text);
  background: #f8fafc;
}

.action-btn-primary {
  border-color: rgba(15, 118, 110, 0.18);
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.action-btn-primary:hover,
.action-btn-primary:focus {
  color: #fff;
  background: linear-gradient(135deg, #0d5f59, #0fa695);
}

.preview-icon,
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-icon svg,
.copy-btn svg,
.close-modal-btn svg {
  width: 20px;
  height: 20px;
}

.amount-panel,
.summary-panel,
.bank-detail-card,
.notice-banner,
.important-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.amount-panel {
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

.field-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.field-value {
  font-size: 1rem;
  font-weight: 600;
}

.amount-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
}

.amount-currency {
  font-size: 0.45em;
  font-weight: 700;
  color: #485163;
}

.summary-panel {
  padding: 1rem;
}

.summary-divider {
  height: 1px;
  background: var(--line);
  margin: 1rem 0;
}

.notice-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
}

.notice-icon,
.important-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

.notice-icon {
  background: var(--info);
}

.important-icon {
  background: var(--warn);
}

.bank-detail-card {
  padding: 0.6rem 1rem;
}

.bank-detail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
}

.bank-detail-row+.bank-detail-row {
  border-top: 1px solid var(--line);
}

.copy-btn {
  width: 38px;
  height: 38px;
  margin-top: 0.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #b3bccb;
}

.copy-btn:hover,
.copy-btn:focus {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-soft);
}

.copy-btn.is-copied {
  color: #0f766e;
}

.important-card {
  margin-top: 1rem;
  padding: 1rem;
}

.important-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.important-card p {
  margin: 0.45rem 0 0;
  color: #2d3442;
}

.okay-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.2rem;
  background: #101721;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.okay-btn:hover,
.okay-btn:focus {
  background: #06090e;
  color: #fff;
}

.pay-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  color: var(--muted);
}

.pay-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.pay-divider strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-modal[hidden] {
  display: none;
}

.invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.invoice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(49, 58, 75, 0.62);
  backdrop-filter: blur(2px);
}

.invoice-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 2rem));
  max-height: calc(100dvh - 4rem);
  margin: 7vh auto 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.invoice-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.8rem 2rem 1rem;
  border-bottom: 1px solid var(--line);
}

.invoice-dialog-header h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.close-modal-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f3f5f8;
  color: #657086;
}

.invoice-content {
  flex: 1;
  min-height: 0;
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 2.4rem;
  margin: 1.4rem 0 1.6rem;
}

.invoice-table-wrap {
  overflow-x: auto;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  padding: 1rem 0.9rem;
  text-align: left;
  white-space: nowrap;
}

.invoice-table thead th {
  background: #f3f5f8;
  color: #3c4658;
  font-size: 0.9rem;
  font-weight: 700;
}

.invoice-table tbody td {
  border-bottom: 1px solid var(--line);
}

.invoice-totals {
  display: grid;
  gap: 0.8rem;
  justify-content: end;
  margin-top: 1.4rem;
}

.invoice-totals>div {
  display: grid;
  grid-template-columns: 120px 180px;
  gap: 1rem;
}

.invoice-totals span {
  color: var(--muted);
}

.invoice-totals strong {
  text-align: right;
}

.invoice-total span,
.invoice-total strong {
  color: var(--text);
  font-size: 1.2rem;
}

.alert {
  border-radius: 18px;
  margin-bottom: 1rem;
}

.page-footer {
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.page-footer-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.page-footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .payment-main {
    padding: 1rem 1.5rem 2rem;
  }

  .payment-container {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .payment-card {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .fincen-logo-image {
    width: min(100%, 150px);
  }

  .summary-topline,
  .bank-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .payment-actions {
    flex-direction: column;
  }

  .invoice-meta-grid {
    grid-template-columns: 1fr;
  }

  .invoice-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    margin-top: 0.5rem;
  }

  .invoice-dialog-header,
  .invoice-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .invoice-dialog-header h2 {
    font-size: 1.55rem;
  }

  .invoice-totals {
    justify-content: stretch;
  }

  .invoice-totals>div {
    grid-template-columns: 1fr auto;
  }
}