@font-face {
  font-family: "Inter";
  src: url("./font/Inter-VariableFont_opsz\,wght.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f9f9fb;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0; /* Ensure no default body margin */
}

/* Main container for the checkout HTML (inside the iframe) */
.checkout-card-container {
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  height: 100%; /* Occupy full height of iframe */
  width: 100%; /* Occupy full width of iframe */
  flex-direction: column; /* Allow sections to stack if needed */
  background-color: #f9f9fb; /* Match body background */
}

/* Generic hidden class for view switching */
.hidden-view {
  display: none !important;
}

/* Payment Details Section (Card/Transfer/USSD Tabs) */
.checkout-card {
  gap: 12px;
  flex-direction: row;
  display: flex; /* Default display for this section */
  height: 100%;
}

.checkout-otp,
.checkout-status {
  /* Unified styling for OTP and Status sections */
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  height: 100%; /* Occupy full height */
  display: flex; /* Default display for these sections */
}

.otp-description {
  text-align: center;
  font-family: "Inter", serif;
}

.otp-description h2 {
  font-weight: 600;
  font-size: 1.5rem;
}

.otp-description p {
  font-weight: 200;
  font-size: 1rem;
  width: 80%;
  line-height: 1.7rem;
  margin: 0 auto;
}

.payment-types {
  padding: 0 0.1rem;
  background-color: #fff;
  border-radius: 14px;
}

/* No longer needed as we use .checkout-card directly */
/* .checkout-container {
  display: flex;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 700px;
  overflow: hidden;
}

.checkout-container section {
  flex: 1;
} */

.tab {
  display: none;
  flex: 1; /* For active tabs */
  flex-direction: column;
  width: 100%;
}

.tab.active {
  display: flex;
}

main {
  flex: 1;
  background-color: #fff;
  padding: 20px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

.amount {
  font-family: "Inter", serif;
  color: #41b06e;
  font-weight: bold;
}

.payment-types ul {
  list-style: none;
  padding: 0;
  width: 100%;
  padding-top: 40px;
}

.payment-types li {
  padding: 1rem 0.8rem;
  border-top: #ebebf1 1px solid;
  cursor: pointer;
  width: 100%;
  font-family: "Inter", serif;
  font-weight: 300;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.payment-types li span {
  display: none;
}

.payment-types h4 {
  display: none;
}

.payment-types li.active {
  background: #f0fff0;
  font-weight: 600;
}

form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

form input {
  width: 100%;
  padding: 0 0.7rem;
  margin: 0.4rem 0;
  border: 1px solid var(--stroke-soft-200, #e1e4ea);
  border-radius: 6px;
  height: 2.9rem;
}

input::placeholder {
  color: #99a0ae;
  font-family: "Inter", serif;
  font-size: 1rem;
}

form .row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

button:not(.default, #returnHome, .icon-btn) {
  padding: 0.7rem 2rem;
  background: #0f4953;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  align-self: flex-end;
  font-family: "Inter", serif;
  font-weight: 300;
  font-size: 14px;
  display: flex; /* For loader spinner */
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.default {
  background-color: #fff;
  border: 0px;
  padding: 0.7rem 2rem;
  cursor: pointer;
}

button > span {
  font-weight: bold;
}

button:not(.default, #returnHome, .icon-btn):hover {
  background: #1e4953;
}

button:not(.default, #returnHome, .icon-btn):disabled {
  background: var(--neutral-50, #f5f7fa);
  color: var(--text-soft-400, #99a0ae);
  font-weight: 600;
  cursor: not-allowed;
}

#cardForm {
  flex: 1;
}

.cardForm > * {
  margin: 21px 0px;
}

.cardForm > p {
  font-family: "Inter", serif;
  font-size: 1rem;
  font-weight: 300;
}

.cardForm label {
  font-family: "Inter", serif;
  font-size: 0.7rem;
  font-weight: 400;
}

#otpForm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1; /* Allow it to take available space */
}

#otpForm p {
  font-family: "Inter", serif;
  font-size: 1rem;
  font-weight: 300;
}

.otp-inputs {
  display: flex;
  gap: 0.5rem;
}

.otp-inputs input {
  width: 3.5rem;
  height: 4rem;
  text-align: center;
  font-size: 1.2rem;
  background-color: #fafaff;
  -moz-appearance: textfield;
  appearance: none;
}

/* Hide arrow buttons for number input */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.otp-footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 20px; /* Add some padding at the bottom */
}

.otp-footer .actions {
  display: flex;
  gap: 1rem;
}

.checkout-card h4 {
  font-size: 1rem;
  width: 100%;
  text-align: center;
  font-family: "Inter", serif;
  font-weight: 600;
}

/* Status Section (replaces checkout-success for all statuses) */
.checkout-status {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  font-family: "Inter", serif;
  background-color: #fff;
  padding: 20px;
  flex: 1;
}

.checkout-success {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-items: center;
}

.success-icon {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

.checkout-status h2 {
  margin-top: 40px;
  margin-bottom: 0;
  text-align: center;
}

.checkout-status p {
  font-weight: 200;
  text-align: center;
}
.checkout-status .hidden-ref {
  display: none;
}

#returnHome {
  background-color: #fff;
  border: 1px solid var(--stroke-soft-200, #e1e4ea);
  padding: 15px 20px;
  box-shadow: 0px 1px 2px 0px #0a0d1408;
  border-radius: 10px;
  font-family: "Inter", serif;
  font-size: 20px;
  cursor: pointer;
  /* margin-bottom: 20px; */
}

.account-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  align-self: center;
  flex: 1;
  font-family: "Inter", serif;
  padding: 20px 0; /* Add padding for content */
}

.account-box > * {
  margin: 5px 0;
}

.trans-instructions {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.account-box .label-name {
  color: #99a0ae;
  margin-top: 5px;
  font-size: 14px;
  margin-bottom: 6px;
}

.account-box .detail {
  font-size: 16px;
  color: #000;
  font-weight: bold;
}

.account-box .acct-number,
.account-box .acct-number > * {
  margin: 0;
}

.wait-instructions {
  text-align: center;
  margin: 20px 12px;
  font-size: 14px;
  color: #6b7280;
}

.wait-instructions span {
  color: #ff4c46;
}

.wait-instructions span.expired {
  font-weight: bold;
  color: #cc0000;
}

.acct-number {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.acct-number img {
  padding: 5px;
  color: #99a0ae;
}

.acct-number span {
  font-weight: normal;
}

.icon-btn {
  padding: 0;
  background-color: unset;
  border: unset;
  cursor: pointer;
  display: flex; /* For icon alignment */
  align-items: center;
}
.icon-btn span {
  font-size: 14px; /* Adjust size for "Copied!" text */
  color: #4caf50;
  font-weight: normal;
  padding-left: 5px;
}

.ussd-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-family: "Inter", serif;
}

.ussd-box .hidden {
  display: none;
}

.ussd-box > div {
  display: flex;
  flex-direction: column;
}

.ussd-box > div > label {
  margin: 5px 0;
  font-size: 14px;
}

.ussd-box select {
  border: 1px solid var(--stroke-soft-200, #e1e4ea);
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-family: "Inter", serif;
}

.ussd-box > * {
  margin: 10px 0;
}

#dial_code_container > * {
  margin: 5px 0;
  font-family: "Inter", serif;
}

#dial_code_container p {
  font-weight: 200;
  font-size: 12px;
  color: #99a0ae;
}

.pin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Higher than main content but lower than SDK modal */
}

.pin-modal.hidden {
  display: none;
}

.pin-content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 320px;
  text-align: center;
}

.pin-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.pin-inputs input {
  width: 50px;
  height: 50px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 24px;
  -moz-appearance: textfield;
  appearance: none;
}

.keypad {
  display: flex;
  justify-content: center;
}

.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key {
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  padding: 16px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.key:hover {
  background: #ddd;
}

.key.delete {
  background: #ffefef;
  color: #cc0000;
}

.key.ok {
  background: #4caf50;
  color: white;
}

.cardNumber {
  width: 100%;
  display: flex;
  flex-direction: row;
  position: relative;
  justify-content: center;
  align-items: center;
}

.cardNumber input {
  position: relative;
  z-index: 5;
}

.card-type {
  position: absolute;
  right: 10px;
  z-index: 20;
}

.error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  text-align: left; /* Align error messages below inputs */
  width: 100%;
}

.bank_transfer_list {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: space-evenly;
  margin-bottom: 10px;
}

.bank_transfer_list > * {
  margin: 5px 0;
}

.bank_transfer_list select {
  border: 1px solid #00000057;
  padding: 10px;
  font-family: "Inter", serif;
  font-size: 16px;
  color: #000000ab;
  border-radius: 6px;
}

.transfer.hidden {
  display: none;
}

.loader-container {
  width: 100%;
  height: auto; /* Adjust height based on content */
  min-height: 100px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

/* The spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top-color: #2563eb; /* blue */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.small {
  width: 20px;
  height: 20px;
  border-width: 3px;
  margin-right: 5px;
}

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

.timer {
  font-size: 14px;
  color: #6b7280;
}
.timer.expired {
  color: #ff4c46;
  font-weight: bold;
}

@media (min-width: 500px) {
  .payment-types {
    padding: 0 1rem;
    width: 220px;
    padding-top: 3rem;
  }

  .payment-types ul {
    padding-top: 0;
  }

  .payment-types h4 {
    display: unset;
    margin-top: 3rem;
  }

  .payment-types li span {
    display: unset;
  }

  .payment-types li {
    justify-content: flex-start;
    gap: 14px;
  }

  form .row {
    flex-direction: row;
  }

  .cardForm label {
    font-size: 1rem;
  }
}
