:root {
  --brand: #1e1853;
  --brand-soft: #5b56a3;
  --border: rgba(30, 24, 83, 0.12);
  --text: #17142f;
  --text-soft: #6f6e77;
  --surface: #ffffff;
  --surface-alt: #fcfbff;
  --shadow: 0 1px 2px rgba(23, 20, 47, 0.06), 0 24px 48px -24px rgba(30, 24, 83, 0.28);
  --radius: 16px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(30, 24, 83, 0.05), transparent 24%),
    linear-gradient(180deg, var(--surface-alt) 0%, var(--surface) 38%);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand svg {
  display: block;
  height: 40px;
  width: auto;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shell {
  width: 100%;
  max-width: 1290px;
  min-height: 240px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 480px;
  border: 1px solid #D9DADC;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.06);
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.headline {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--brand);
}

.merchant-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: stretch;
}

.merchant {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  color: #050033;
}

.type {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #5E5B73;
}

.divider {
  border: 0;
  border-top: 1px solid #D9DADC;
  margin: 0;
  width: 100%;
}

.label {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #5E5B73;
}

.value {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #38364D;
}

.amount {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  color: #050033;
}

.notice {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: #F7F5FF;
  border-radius: 6px;
  color: #001159;
  font-size: 14px;
  line-height: 20px;
}

.notice__icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #524F81;
}

.cta {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #B7B3EC;
  border-radius: 100px;
  background: linear-gradient(264deg, #524F81 5.7%, #050033 92.46%);
  color: #F9F9FF;
  font: inherit;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.cta:hover {
  transform: translateY(-1px);
}

.cta:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.state {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 16px;
}

.state__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  color: var(--text-soft);
}

.state__title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--brand);
}

.state__merchant {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.state__message {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.state-no-results {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1250px;
  height: 320px;
  padding: 80px 0;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #dadadd;
  border-radius: 8px;
}

.state-no-results__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(328px, calc(100% - 32px));
  gap: 8px;
  text-align: center;
}

.state-no-results__content--not-found {
  width: min(389px, calc(100% - 32px));
}

.state-no-results__content--technical {
  width: min(211px, calc(100% - 32px));
}

.state-no-results__heading--technical {
  width: 100%;
}

.state-no-results--technical .state-no-results__title {
  color: #38364d;
}

.state-no-results__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.state-no-results .state__icon {
  width: 48px;
  height: 48px;
  margin: 0;
  color: #5e5b73;
}

.state-no-results__title {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: #232136;
}

.state-no-results__message,
.state-no-results__hotel {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #38364d;
  text-align: center;
}

.state-no-results__hotel {
  font-weight: 500;
}

.technical-retry {
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 40px;
  padding: 7px 16px 7px 12px;
  gap: 4px;
  border: 1px solid #050033;
  border-radius: 25px;
  background: #ffffff;
  color: #1e1852;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
  cursor: pointer;
}

.technical-retry__icon {
  flex: 0 0 18px;
  color: #050033;
}

.technical-retry:hover {
  background: #f7f5ff;
}

.technical-retry:focus-visible {
  outline: 2px solid #524f81;
  outline-offset: 2px;
}

.state__icon--success {
  color: #006a53;
}

.state__references {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.state__contact {
  margin: 1.25rem auto 0;
  max-width: 320px;
  text-align: left;
}

.state__contact-value {
  margin-bottom: 0.5rem;
}

.state__summary {
  margin: 1.5rem auto 0;
  max-width: 320px;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.state__summary-amount {
  font-size: 1.7rem;
  margin-bottom: 0;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
  padding: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(84, 111, 216, 0.2);
  border-top-color: #546fd8;
  animation: spin 0.85s linear infinite;
}

.retry {
  width: auto;
  padding: 0.75rem 1rem;
  min-height: 42px;
  margin-top: 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 24, 83, 0.24);
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.inline-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  animation: spin 0.75s linear infinite;
}

.hidden {
  display: none !important;
}

.payment-page {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 40px;
  align-items: start;
  padding: 24px;
}

.payment-page__summary {
  min-width: 0;
  padding-right: 40px;
  border-right: 1px solid var(--border);
}

.payment-summary {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}


.payment-page__module {
  display: flex;
  justify-content: center;
}

.payment-card-box {
  width: 100%;
}

.payment-card-box__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--brand);
  font-weight: 600;
}

.payment-card-box__icon {
  flex-shrink: 0;
}

.payment-card-box__hint {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.payment-card-box__networks {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.payment-card-box__network {
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
}

.payment-card-box__network--visa {
  background: #2746c7;
}

.payment-card-box__network--mc {
  background: #f06722;
}

.payment-card-box__network--amex {
  background: #1692d0;
}

.card-module-frame {
  width: 100%;
  height: 560px;
  min-height: 560px;
  overflow: visible;
}

.card-module-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.payment-card-box__submit {
  margin-top: 0;
  min-height: 48px;
  width: 100%;
  align-self: stretch;
  background: #050033;
  border: none;
}

.payment-card-box__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  gap: 9px;
  background: #F7F5FF;
  align-self: stretch;
}

.payment-card-box__disclaimer {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #5E5B73;
  text-align: center;
  align-self: stretch;
}

.module-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(17, 120, 70, 0.08);
  color: #117846;
  font-size: 0.9rem;
  line-height: 1.4;
}

.module-status--error {
  background: rgba(180, 36, 24, 0.08);
  color: #b42418;
}

.alert {
  margin: 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  isolation: isolate;
}

.alert--success {
  background: #CAFFEA;
  color: #006A53;
  border: none;
}

.alert--error {
  background: rgba(180, 36, 24, 0.06);
  color: #b42418;
  border: 1px solid rgba(180, 36, 24, 0.16);
}

.alert__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.reference {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: #38364D;
}

.card--success {
  box-sizing: border-box;
  width: 480px;
  max-width: 100%;
  height: 407px;
  align-items: flex-start;
  flex: none;
}

.card--success > .merchant-block,
.card--success > .alert,
.card--success > .field-block {
  width: 100%;
  align-self: stretch;
}

.card--success > .divider {
  width: 424px;
  max-width: calc(100% + 18px);
  margin-left: -9px;
  flex: none;
}

.card--success .alert--success {
  min-height: 48px;
}

.card--success .alert--success > span {
  flex: 1;
}

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

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .shell {
    padding: 14px;
  }

  .card {
    padding: 24px;
    gap: 14px;
  }

  .card--success {
    width: 100%;
    height: auto;
  }

  .card--success > .divider {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .amount {
    font-size: 22px;
  }

  .state-no-results {
    height: auto;
    min-height: 280px;
    padding: 48px 0;
  }
}

@media (max-width: 900px) {
  .shell {
    padding: 0;
  }

  .payment-page {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }

  .payment-page__summary {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .payment-summary {
    max-width: none;
    padding-top: 0;
  }
}
