:root {
  --text: #2e2e2e;
  --muted: #10003d94;
  --line: #d7d7d7;
  --field-icon: #a1a3be;
  --soft: #e4e4e4;
  --accent: #adf205;
  --pci: #225e63;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fff;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Montserrat, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.checkout-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 14px 16px 14px;
}

.checkout-panel {
  width: min(100%, 430px);
}

.checkout-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 8px;
}

.brand-logo {
  display: block;
  width: 126px;
  height: auto;
  justify-self: center;
}

.cancel-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: #818181;
  cursor: pointer;
}

.cancel-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.payment-form {
  display: flex;
  flex-direction: column;
}

.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 700;
}

.timer span {
  display: grid;
  width: 24px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  background: #2e2e2e;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.timer b {
  padding: 0 1px;
  color: #2e2e2e;
  font-size: 18px;
  line-height: 1;
}

.amount-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 14px;
  padding: 8px 8px 8px 20px;
  border-radius: 15px;
  background: var(--soft);
  color: #00000094;
  font-weight: 500;
}

.amount-card label {
  color: #00000094;
  font-size: 16px;
  font-weight: 500;
}

.amount-edit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 140px;
  justify-content: flex-end;
  padding: 4px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 12px;
  background: #f8f8f8;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  cursor: text;
}

.amount-edit:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px #adf20533;
}

.amount-edit input {
  width: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  text-align: right;
  outline: none;
  cursor: text;
}

.amount-edit input:focus {
  text-decoration: none;
}

.amount-edit span {
  font-size: inherit;
}

.amount-card strong {
  padding: 0 5px 6px;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
}

.field {
  width: 100%;
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.field-control {
  position: relative;
}

.field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 36px 8px 32px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.field input:focus {
  border-bottom-color: #b8b8b8;
}

.field-control svg {
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  color: var(--field-icon);
  fill: currentColor;
  pointer-events: none;
}

.field input:focus + svg {
  color: #818181;
}

.field-row {
  display: flex;
  gap: 20px;
}

.field-row .field {
  width: calc(50% - 10px);
  margin-bottom: 16px;
}

.field-row input {
  max-width: 112px;
  padding-right: 5px;
}

.cvv {
  -webkit-text-security: disc;
}

.save-card {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 42px 0 16px;
  border-radius: 20px;
  background: #ffffff5c;
  color: var(--text);
  cursor: pointer;
}

.save-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 3px;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffffffde, #dbdbdbde);
  content: "";
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

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

.save-card span {
  font-size: 12px;
  font-weight: 500;
}

.save-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #f2f2f2;
  color: #878787;
  line-height: 1;
}

.save-card i {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #e5e5e5;
  box-shadow: inset 0 4px 4px #dfd9da;
  transform: translateY(-50%);
}

.save-card input:checked ~ i {
  background: var(--accent);
  box-shadow: none;
}

.save-card input:checked ~ i::after {
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: solid #2e2e2e;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.submit-button {
  width: 100%;
  min-height: 45px;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-radius: 15px;
  background: #2e2e2e;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 0 20px #2e2e2e2a;
}

.submit-button:disabled {
  background: #b8b8b8;
  color: #fff;
  cursor: not-allowed;
  box-shadow: none;
}

.security-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 12px;
  color: var(--pci);
}

.pci-badge {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 7px;
  color: var(--pci);
}

.pci-badge strong {
  font-size: 43px;
  font-weight: 800;
  line-height: .8;
  letter-spacing: 0;
}

.pci-badge span {
  max-width: 95px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
}

.visa-badge {
  color: #1434cb;
  font-size: 35px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
}

.mc-badge {
  position: relative;
  width: 70px;
  height: 44px;
}

.mc-badge span {
  position: absolute;
  top: 5px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.mc-badge span:first-child {
  left: 9px;
  background: #eb001b;
}

.mc-badge span:last-child {
  right: 9px;
  background: #f79e1b;
  mix-blend-mode: multiply;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #00000052;
  backdrop-filter: blur(6px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(100%, 410px);
  padding: 28px 28px 26px;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 28px 70px #0000002e;
  color: var(--text);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eeeeee;
  color: #818181;
  cursor: pointer;
}

.auth-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-stage.is-active {
  display: flex;
}

.auth-logo {
  width: 118px;
  height: auto;
  margin-bottom: 22px;
}

.auth-stage h2 {
  margin: 0 0 10px;
  color: #151515;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.auth-stage p {
  max-width: 315px;
  margin: 0 0 20px;
  color: #10003d94;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.auth-spinner {
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  border: 6px solid #eeeeee;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: authSpin .85s linear infinite;
}

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

.auth-card-line,
.auth-summary {
  width: 100%;
  border-radius: 18px;
  background: #f4f4f4;
}

.auth-card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.auth-card-line span,
.auth-summary span {
  color: #10003d94;
  font-size: 12px;
  font-weight: 500;
}

.auth-card-line strong,
.auth-summary strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.auth-icon {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: #eeeeee;
  box-shadow: inset 0 2px 8px #00000012;
}

.auth-icon svg {
  width: 54px;
  height: 54px;
  color: #a1a3be;
  fill: currentColor;
}

.auth-icon-done {
  background: #e8f6e9;
}

.auth-icon-done svg {
  color: #51b75b;
}

.auth-state-image {
  display: block;
  width: min(170px, 54vw);
  height: auto;
  margin-bottom: 18px;
}

.auth-summary {
  display: grid;
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
}

.auth-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: #f4f4f4;
}

.auth-primary {
  width: 100%;
  min-height: 45px;
  padding: 14px 18px;
  border: 0;
  border-radius: 15px;
  background: #2e2e2e;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.auth-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-primary:hover,
.auth-primary:focus-visible {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 0 20px #2e2e2e2a;
}

.resend-link,
.auth-link-button {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid #d7d7d7;
  border-radius: 12px;
  background: #fff;
  color: #2e2e2e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.resend-link:hover,
.resend-link:focus-visible,
.auth-link-button:hover,
.auth-link-button:focus-visible {
  border-color: #adf205;
  background: #f7ffe6;
}

.resend-link {
  width: 100%;
}

.otp-row {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.otp-row input {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 10px;
  background: #f4f4f4;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.otp-row input:focus {
  border-bottom-color: var(--accent);
}

.state-shell {
  padding-top: 18px;
  padding-bottom: 18px;
}

.state-panel {
  display: flex;
  min-height: min(760px, calc(100vh - 36px));
  flex-direction: column;
  justify-content: center;
}

.state-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 22px;
}

.state-logo {
  width: 148px;
}

.state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.state-amount {
  width: 100%;
  margin-bottom: 28px;
}

.state-title {
  margin: 0 0 16px;
  color: #e1565c;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.state-image {
  display: block;
  width: min(210px, 58vw);
  height: auto;
  margin-bottom: 30px;
}

.return-link {
  display: inline-flex;
  min-width: 230px;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 15px;
  background: #2e2e2e;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.return-link:hover,
.return-link:focus-visible {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 0 20px #2e2e2e2a;
}

.state-security {
  margin-top: 34px;
}

.success-panel {
  width: min(100%, 520px);
}

.success-card {
  width: min(100%, 430px);
  margin-inline: auto;
  padding: 28px 28px 34px;
  border-radius: 52px;
  background: #fff;
  box-shadow: 0 22px 55px #00000014;
}

.success-card .state-amount {
  margin-bottom: 20px;
}

.completed-title {
  margin-bottom: 16px;
  color: #101010;
  font-size: 26px;
}

.success-image {
  display: block;
  width: min(220px, 58vw);
  height: auto;
  margin-bottom: 24px;
}

.success-card .return-link {
  width: 100%;
}

@media (max-width: 767px) {
  .checkout-shell {
    align-items: flex-start;
    padding: 16px 15px 18px;
  }

  .checkout-panel {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .checkout-header {
    margin-bottom: 16px;
  }

  .brand-logo {
    width: 148px;
  }

  .timer {
    margin-bottom: 14px;
  }

  .amount-card {
    gap: 8px;
    min-height: 40px;
    margin-bottom: 18px;
    padding: 3px 8px 3px 20px;
  }

  .amount-card span,
  .amount-card label,
  .field label {
    font-size: 12px;
  }

  .amount-card strong,
  .amount-edit {
    min-width: 112px;
    font-size: 20px;
    padding: 3px 8px;
    padding-bottom: 0;
  }

  .amount-edit input {
    width: 68px;
  }

  .field {
    margin-bottom: 15px;
  }

  .field input {
    min-height: 34px;
    padding: 8px 19px 4px 20px;
    font-size: 14px;
  }

  .field-control svg {
    width: 16px;
    height: 16px;
  }

  .field-row {
    gap: 14px;
  }

  .field-row .field {
    width: calc(50% - 7px);
    margin-bottom: 15px;
  }

  .field-row input {
    max-width: 92px;
  }

  .save-card {
    margin-bottom: 8px;
    padding-right: 38px;
  }

  .save-card i {
    right: 11px;
  }

  .submit-button {
    border-radius: 10px;
  }

  .security-logos {
    gap: 16px;
    margin-top: 20px;
    transform: scale(.9);
  }

  .auth-dialog {
    padding: 24px 18px 22px;
    border-radius: 24px;
  }

  .auth-logo {
    width: 106px;
  }

  .auth-stage h2 {
    font-size: 20px;
  }

  .otp-row {
    gap: 6px;
  }

  .otp-row input {
    border-radius: 8px;
    font-size: 20px;
  }

  .state-panel {
    min-height: calc(100vh - 36px);
  }

  .state-header {
    margin-bottom: 16px;
  }

  .state-logo {
    width: 140px;
  }

  .state-title {
    margin-bottom: 12px;
    font-size: 28px;
  }

  .state-image {
    width: min(180px, 56vw);
    margin-bottom: 24px;
  }

  .return-link {
    width: 100%;
    border-radius: 10px;
  }

  .state-security {
    margin-top: 24px;
  }

  .success-panel {
    width: 100%;
  }

  .success-card {
    width: 100%;
    padding: 24px 20px 28px;
    border-radius: 34px;
  }

  .completed-title {
    font-size: 24px;
  }

  .success-image {
    width: min(190px, 58vw);
  }
}
