/* Light */
@font-face {
  font-family: "Noto Sans";
  font-weight: 300;
  src:
    url("../fonts/NotoSans-Light.woff") format("woff2"),
    url("../fonts/NotoSans-Light.woff") format("woff");
}

/* Regular */
@font-face {
  font-family: "Noto Sans";
  font-weight: 400;
  src:
    url("../fonts/NotoSans-Regular.woff2") format("woff2"),
    url("../fonts/NotoSans-Regular.woff") format("woff");
}

/* Medium */
@font-face {
  font-family: "Noto Sans";
  font-weight: 500;
  src:
    url("../fonts/NotoSans-Medium.woff2") format("woff2"),
    url("../fonts/NotoSans-Medium.woff") format("woff");
}

:root {
  --border-color: #e2e8f0;
  --primary-color: #29589e;
  --primary-font-color: black;
  --secondary-font-color: #334155;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --input-height: 64px;
  --error-color: #d32f2f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.2;
}

body {
  font-family: "Noto Sans", sans-serif;
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* Large Screen Layout */
@media (min-width: 700px) {
  .main-container {
    display: grid;
    grid-template-columns: 320px minmax(400px, 532px);
    grid-template-rows: auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    grid-gap: 20px;
    padding: 20px;
  }

  .order-description-container {
  }

  .form-container {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    padding-left: 40px;
    padding-right: 20px;
    border-left: 1px solid var(--border-color);
  }

  .powered-by-container {
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--secondary-font-color);
    font-size: 14px;
  }
}

/* Small Screen Layout */
@media (max-width: 699px) {
  body {
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
    align-items: flex-start !important;
    min-height: 100vh;
  }

  .main-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, fit-content(100%));
    border: none;
    border-radius: 0;
    grid-gap: 20px;
  }

  .order-description-container {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .merchant-logo-container {
    margin-bottom: 16px !important;
    margin-top: 10px !important;
  }

  .merchant-logo-container img {
    max-height: 50px !important;
  }

  #merchant-name {
    margin-bottom: 4px !important;
  }

  #cost {
    font-size: 28px !important;
    margin-bottom: 20px !important;
    margin-top: 4px !important;
    padding-top: 4px;
  }

  .form-container {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    padding-left: 0;
    padding-right: 0;
    border-left: none;
  }

  .powered-by-container {
    grid-column: 1/ 2;
    grid-row: 3 / 4;
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--secondary-font-color);
    font-size: 14px;
  }
}

h2 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--primary-font-color);
}

label {
  margin-top: 20px;
  margin-bottom: 12px;
  padding-right: 20px;
  font-size: 16px;
  color: var(--primary-font-color);
}

input,
select {
  height: var(--input-height);
  padding-left: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-family: "Noto Sans", sans-serif;
  width: 100%;
}

input::placeholder {
  color: #757575;
}

select {
  padding-right: 20px;
  background-color: white;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
}

button {
  margin-top: 20px;
  background: var(--primary-color);
  height: 56px;
  color: white;
  font-size: 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button:hover {
  opacity: 0.9;
}

.card-details-input-container {
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.card-details-input-container.input-error {
  border: 1px solid var(--error-color);
  border-radius: 8px;
}

.card-details-input-container input#card-number {
  border-radius: 8px 8px 0 0;
  border: none;
}

.mpgs-field {
  display: block;
}

.cybersource-field {
  display: none;
}

.month-year-input-container {
  display: flex;
}

.month-year-input-container div:first-child {
  /*max-width: calc(50% - 1px);*/
  /*max-width: 235px;*/
  /*max-width: 50%;*/
  flex: 1;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.month-year-input-container div:last-child {
  /*max-width: calc(50% - 1px);*/
  /*max-width: 235px;*/
  /*max-width: 50%;*/
  flex: 1;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

#expiry-month,
#expiry-month-select {
  border-radius: 0;
  border: none;
}

#expiry-year,
#expiry-year-select {
  border-radius: 0;
  border: none;
}

/* CyberSource dropdown arrows - with gray arrow */
#expiry-month-select,
#expiry-year-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  color: black;
}

/* Select placeholder styling - make disabled options gray */
#expiry-month-select option[disabled] {
  color: #757575;
}

#expiry-year-select option[disabled] {
  color: #757575;
}

/* Ensure selected values are black */
#expiry-month-select option:not([disabled]) {
  color: black;
}

#expiry-year-select option:not([disabled]) {
  color: black;
}

/* Classes for dynamic text color */
.select-placeholder {
  color: #757575 !important;
}

.select-selected {
  color: black !important;
}

.card-details-input-container input#security-code {
  border-radius: 0 0 8px 8px;
  border: none;
}

/* CyberSource specific styling */
.cybersource-field {
  height: var(--input-height);
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 16px;
  font-family: "Noto Sans", sans-serif;
  width: 100%;
  background: white;
}

.card-details-input-container .cybersource-field#card-number-field {
  border-radius: 8px 8px 0 0;
}

.card-details-input-container .cybersource-field#security-code-field {
  border-radius: 0 0 8px 8px;
}

.month-year-input-container .cybersource-field#expiry-month-field {
  border-radius: 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.month-year-input-container .cybersource-field#expiry-year-field {
  border-radius: 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

#card-number-container {
  position: relative;
}

.payment-brands-image {
  position: absolute;
  right: 15px;
  height: 26px;
  top: calc(var(--input-height) - 44px);
}

/* order-description-container */

.merchant-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  margin-top: 20px;
}

.merchant-logo-container img {
  max-width: 180px;
  max-height: 100px;
}

#merchant-name {
  width: 100%;
  color: var(--secondary-font-color);
  font-size: 16px;
  margin-bottom: 8px;
}

#cost {
  font-size: 24px;
  color: black;
  font-weight: 500;
  margin-bottom: 16px;
}

.two-column-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.two-column-container .value {
  text-align: right;
  max-width: 60%;
}

.order-description-container {
  .label {
    color: var(--secondary-font-color);
    font-size: 14px;
    margin-top: 8px;
  }

  .value {
    color: var(--primary-font-color);
    font-size: 14px;
    margin-top: 8px;
    font-weight: var(--font-weight-medium);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

.border-bottom {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

/* powered-by-container */

.powered-by-container img {
  width: 120px;
  margin-top: 8px;
  margin-bottom: 20px;
}

.term-and-conditions {
  font-size: 14px;
}

.term-and-conditions a {
  text-decoration: none;
  color: var(--primary-color);
}

#error-message-container,
#cardholder-error-message-container {
  font-size: 14px;
  color: var(--error-color);
  margin-top: 8px;
  line-height: 14px;
  padding-left: 12px;
}

#forbidden-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

#cardholder-name.error {
  border: 1px solid var(--error-color);
}

/* Error Overlay */
#error-overlay {
  align-items: center;
  justify-content: center;
}

#error-overlay.show {
  display: flex;
}

#error-overlay.hide {
  display: none;
}

#error-overlay-container {
  width: 400px;
  background: white;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  filter: drop-shadow(5px 5px 10px #000000);
}

#error-overlay .error-overlay-message {
  text-align: center;
  font-size: 20px;
  color: black;
  margin-top: 16px;
}

#error-overlay button {
  padding: 12px;
  width: 100px;
  margin-top: 16px;
}

/* payment-status.html styles */

.payment-status-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.payment-status-container .title {
  font-size: 20px;
  font-weight: 500;
  margin-top: 16px;
  color: var(--primary-font-color);
}

.payment-status-container .subtitle {
  font-size: 14px;
  color: var(--secondary-font-color);
  margin-top: 8px;
  margin-bottom: 16px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  height: 100vh;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header p {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.close-button {
  width: 24px;
  height: 24px;
  border: 2px solid #333;
  border-radius: 50%;
  background: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  color: black;
  /* SVG uses currentColor */
  transition: all 0.3s ease;

  margin-top: 0 !important;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.close-button svg {
  width: 12px;
  height: 12px;
  display: block;
}

.close-button:hover {
  background: #333;
  color: white;
}

.dropdown {
  position: relative;
}

.dropdown-button {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: #333333;
}

.dropdown-arrow {
  display: inline-flex;
  align-items: center;
}

.dropdown-arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.dropdown-item:hover {
  background: #f8f9fa;
}

.account-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.account-item:hover {
  border-color: #0f5f7a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 95, 122, 0.1);
}

.account-item.selected {
  border-color: #0f5f7a;
  background: #f0f8ff;
}

.account-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #666;
  margin-right: 15px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
}

.account-check svg {
  width: 14px;
  height: 14px;
  display: block;
}

.account-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.account-info p {
  color: #666;
  font-size: 14px;
}

.add-account {
  background: #f8f9fa;
  border-color: #28a745;
}

.add-account:hover {
  border-color: #28a745;
  background: #f0fff4;
}

.add-check {
  background: #28a745;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 0px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #0f5f7a;
}

.form-control:disabled {
  background-color: #f8f9fa;
  color: #666;
}

.btn {
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: normal;
  line-height: 1.5;
}

.consent-checkbox {
  margin-top: 4px;
  width: 16px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text {
  font-size: 14px;
  color: #555;
  user-select: none;
}

.checkbox-label:hover .checkbox-text {
  color: #333;
}

.bank-accounts-title {
  margin: 8px 0 16px 0;
}

.resend-container {
  margin-top: 15px;
}

.resend-timer {
  font-size: 14px;
  color: #666;
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.resend-timer span {
  font-weight: 600;
  color: #007bff;
}

.resend-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
  display: inline-block;
}

.resend-link:hover {
  color: #0056b3;
}

.resend-link.disabled {
  color: #6c757d;
  cursor: not-allowed;
  text-decoration: none;
}

.status-message {
  padding: 12px 0;
  border-radius: 8px;
  margin-top: 10px;
}

.status-error {
  color: var(--error-color);
}

.form-container > div {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.session-timer {
  padding-top: 20px;
  display: flex;
  justify-content: center;
}

.session-expired-title {
  font-size: 20px;
  padding-bottom: 10px;
}

#accountsList {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
  margin-bottom: 10px;
  padding-top: 5px;
}

#accountsList::-webkit-scrollbar {
  width: 6px;
}

#accountsList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#accountsList::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#accountsList::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

@media (min-width: 500px) {
  .payment-status-container .payment-description-container {
    border: 1px solid var(--border-color);
    padding: 56px 24px 36px;
    width: 500px;
    border-radius: 8px;
  }

  .payment-status-container .item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
  }

  .payment-status-container .item .label {
    flex: 0 0 auto;
    max-width: 30%;
  }

  .payment-status-container .item .value {
    flex: 1;
    max-width: 70%;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    padding: 0;
  }
}

@media (max-width: 500px) {
  .payment-status-container .payment-description-container {
    border: 1px solid var(--border-color);
    padding: 56px 24px 36px;
    border-radius: 8px;
  }

  .payment-status-container .item {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    gap: 4px;
  }
}

.payment-status-container .label {
  font-size: 16px;
  color: var(--secondary-font-color);
}

.payment-status-container .value {
  font-size: 16px;
  color: var(--primary-font-color);
  font-weight: var(--font-weight-medium);
  padding: 6px 0;
}

.payment-status-container hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

.payment-status-container .download-receipt {
  padding: 12px;
}

.payment-status-container .error-container {
  border-radius: 8px;
  border: 1px solid var(--error-color);
  background: #feeceb;
  padding: 16px;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}
