.open-payment {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all .3s;
  padding: 10px;
  cursor: pointer;
  background: #ffc400;
  border: 2px solid #ffc400;
  color: #000;
  padding: 5px 20px;
  text-transform: uppercase;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  width: 200px;
  height: 140px;
  margin-right: 7px;
}

.open-payment:hover {
  background: #ffa300;
  border-color: #ffa300;
}

#pw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.pw-popup {
  max-width: 420px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.pw-popup-inner {
  padding: 20px;
}

.pw-step {
  display: none;
}

.pw-step.active {
  display: block;
}

.pw-accent {
  color: #ffc400;
  font-weight: bold;
}

.pw-info-icon {
  font-size: 16px;
  vertical-align: middle;
  margin-right: 4px;
}



/* --- Card --- */
.pw-card {
  height: 200px;
  border-radius: 16px;
  margin-bottom: 20px;
  position: relative;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.2);
}

.pw-locked .pw-lock {
  width: 64px;
  height: 64px;
  background: url('https://img.icons8.com/ios-filled/100/ffffff/lock.png') center/contain no-repeat;
}

.pw-open .pw-card-number {
  font-size: 24px;
  letter-spacing: 2px;
  color: #ffc400;
  font-weight: bold;
  animation: pw-fade-in .3s ease;
}

@keyframes pw-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.pw-brand {
  position: absolute;
  top: 16px;
  right: 16px;
}

.pw-card-logo {
  height: 32px;
  width: auto;
}

/* --- Form Fields --- */
.pw-field {
  margin-bottom: 14px;
}

.pw-field label {
  font-size: 13px;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

.pw-field input,
.pw-field textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.pw-field input::placeholder,
.pw-field textarea::placeholder {
  font-size: 14px;
  color: #aaa;
  font-weight: normal;
}

.pw-field textarea {
  height: 70px;
  resize: none;
}

/* --- Buttons --- */
.pw-buttons {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
}

.pw-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.pw-btn.pw-primary {
  background: #0b83f5;
  color: #fff;
}

.pw-btn.pw-cancel,
.pw-btn.pw-back {
  background: #ddd;
  /* background: #ffc400; */
  border: 2px solid #888;
  color: #000;
  padding: 5px 20px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 15px;
}

/* --- Messages --- */
.pw-info {
  font-size: 16px;
  margin-bottom: 15px;
  color: #2d3748;
}

.pw-error-msg {
  font-size: 14px;
  color: #F87171;
  margin-bottom: 6px;
}

/* --- File Upload --- */

.pw-upload-btn-wrapper {
  position: relative;
  /* display: inline-block; */
}

.pw-upload-btn-wrapper input[type=file] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.pw-upload-btn-wrapper {
  display: flex;
  justify-self: start;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .3s;
}

#pw-file {
  display: none;
}

.pw-upload-btn-wrapper .pw-upload-btn label {
  color: #FFFFFF;
}

.pw-upload-btn-wrapper .pw-upload-btn {
  margin-top: 10px;
  background: #192f61;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s ease;
}

.pw-upload-btn-wrapper .pw-upload-btn:hover {
  background: #1c346c;
}

.pw-upload-msg {
  display: flex;
  margin-top: 8px;
  font-size: 14px;
  color: #4ade80;
}

.pw-upload-btn {
  cursor: pointer;
}

.pw-upload-icon {
  cursor: pointer;
  background: url('./icons/download.svg');
  mask: url('./icons/download.svg') center/contain no-repeat;
  -webkit-mask: url('./icons/download.svg') center/contain no-repeat;
  width: 25px;
  height: 25px;
  margin-right: 5px;
  background-size: 25px 25px;
}

.pw-upload-msg {
  font-size: 14px;
  color: #4ADE80;
  margin-top: 6px;
}

h2.pw-header {
  font-family: Montserrat, serif;
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
  padding: 10px;
  color: #222;
}

/* --- Dark Theme Overrides --- */
body.dark-theme .pw-popup {
  background: #1f1f1f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.dark-theme .pw-field label {
  color: #ccc;
  text-transform: uppercase;
}

body.dark-theme h2.pw-header {
  color: #ccc;
}


body.dark-theme .pw-field input,
body.dark-theme .pw-field textarea {
  background: #2b2b2b !important;
  border: 1px solid #555;
  color: #eee;
}

body.dark-theme .pw-btn.pw-cancel,
body.dark-theme .pw-btn.pw-back {
  background: #555;
  color: #eee;
}

body.dark-theme .pw-info {
  color: #ccc;
}

body.dark-theme .pw-upload-msg {
  color: #ccc;
}


.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 5px;
  vertical-align: middle;
}

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

.success-icon {
  color: #4caf50;
  margin-right: 5px;
}

/* --- Media Queries --- */

/* Tablet (portrait and landscape) */
@media screen and (max-width: 1024px) {

  form.payment-form-new {
    width: 120px !important;
    height: 90px !important;
    margin: 10px;
  }

  .open-payment-wrapper {
    padding: 10px 0;
  }

  .open-payment {
    width: 120px;
    height: 90px;
    margin: 10px;
  }

  .pw-popup input {
    max-width: 100% !important;
  }

  .pw-card {
    height: 180px;
  }

  .pw-open .pw-card-number {
    font-size: 22px;
  }

  h2.pw-header {
    font-size: 22px;
  }
}

/* Phone (portrait and landscape) */
@media screen and (max-width: 768px) {
  #pw-overlay {
    padding: 10px;
  }

  .pw-popup {
    max-width: 100%;
  }

  .pw-popup-inner {
    padding: 15px;
  }

  .pw-popup input {
    max-width: 100% !important;
  }

  .pw-card {
    height: 160px;
  }

  .pw-locked .pw-lock {
    width: 48px;
    height: 48px;
  }

  .pw-open .pw-card-number {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .pw-card-logo {
    height: 24px;
  }

  .pw-brand {
    top: 12px;
    right: 12px;
  }

  h2.pw-header {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .pw-field {
    margin-bottom: 12px;
  }

  .pw-field label {
    font-size: 12px;
  }

  .pw-field input,
  .pw-field textarea {
    padding: 8px;
    font-size: 13px;
  }

  .pw-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .pw-btn {
    width: 100%;
    padding: 12px;
  }

  .pw-upload-btn-wrapper .pw-upload-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* Small phones */
@media screen and (max-width: 480px) {

  form.payment-form-new {
    margin: 5px;
  }

  .payment__gallery {
    justify-content: center;
  }

  .pw-popup input {
    max-width: 100% !important;
  }

  .open-payment {
    font-size: 14px;
    width: 120px;
    height: 90px;
    margin: 5px;
    /* margin: 12px 0; */
  }

  .pw-card {
    height: 140px;
  }

  .pw-open .pw-card-number {
    font-size: 18px;
  }

  h2.pw-header {
    font-size: 18px;
  }

  .pw-field textarea {
    height: 60px;
  }
}