/* Wedigitalhub Multi Step Payment Forms — Frontend Styles */

.wdh-form-wrap {
  --wdh-blue: #3971f4;
  --wdh-blue-dark: #2f46e0;
  --wdh-text: #1e1e1e;
  --wdh-muted: #676767;
  --wdh-border: #a2a2a2;
  --wdh-bg-card: #ffffff;
  --wdh-radius: 16px;

  max-width: 730px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: Geist, sans-serif;
  color: var(--wdh-text);
  box-sizing: border-box;
}

.wdh-form-wrap *,
.wdh-form-wrap *::before,
.wdh-form-wrap *::after {
  box-sizing: border-box;
}

.wdh-price-blue {
  color: var(--wdh-blue);
}

/* ---------- Progress bar ---------- */
.wdh-progress {
  display: flex;
  justify-content: space-between;
  margin: 0 auto 60px;
  position: relative;
  max-width: 730px;
}

.wdh-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 150px;
  position: relative;
  z-index: 10;
}

.wdh-progress-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #d6dae5;
  background: #fff;
  display: block;
  position: relative;
}

.wdh-progress-step.is-active .wdh-progress-dot {
  border-color: var(--wdh-blue);
}

.wdh-progress-step.is-complete .wdh-progress-dot {
  border-color: var(--wdh-blue);
  background: var(--wdh-blue);
}

.wdh-progress-label {
  color: #ddd;
  text-align: center;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  text-transform: capitalize;
}

.wdh-progress-step.is-active .wdh-progress-label {
  color: var(--wdh-text);
  font-weight: 600;
}

.wdh-progress-step.is-complete .wdh-progress-label {
  color: var(--wdh-text);
}

.wdh-progress-line {
  flex: 1;
  height: 4px;
  background: #d9d9d9;
  position: absolute;
  top: 7.5px;
  width: calc(50% - 75px);
}

.wdh-progress-line.left-line {
  left: 0;
  margin-left: 75px;
}

.wdh-progress-line.right-line {
  right: 0;
  margin-right: 75px;
}

.wdh-progress-line.full-line {
  left: 0;
  margin-left: 75px;
  width: calc(100% - 150px);
}

.wdh-progress-line.no-line {
  display: none;
}

.wdh-progress-line-fill {
  position: absolute;
  inset: 0;
  background: var(--wdh-blue);
  width: 0%;
  transition: width 0.3s ease;
}

/* ---------- Card ---------- */
.wdh-card {
  background: var(--wdh-bg-card);
  border-radius: var(--wdh-radius);
  box-shadow: 0 1px 16px rgba(57, 113, 244, 0.2);
  padding: 24px;
  max-width: 730px;
  margin-inline: auto;
}

.wdh-card-header {
  margin-bottom: 28px;
}

.wdh-package-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  text-transform: capitalize;
  font-family: "Clash Display Variable";
}

.wdh-package-price {
  color: var(--wdh-blue);
  font-weight: 600;
}

.wdh-section-title {
  font-size: 16px;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  color: var(--wdh-blue);
  margin: 30px 0 12px;
  font-weight: 500;
  font-family: "Clash Display Variable";
}

.wdh-section-title:first-child {
  margin-top: 0;
}

/* ---------- Fields ---------- */

.wdh-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
}

.wdh-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wdh-field-full {
  grid-column: 1 / -1;
}

.wdh-field label {
  font-size: 12px;
  color: var(--wdh-border);
}

.wdh-hint {
  font-weight: 400;
  color: var(--wdh-muted);
  font-size: 11px;
}

.wdh-field input[type="text"],
.wdh-field input[type="email"],
.wdh-field input[type="tel"],
.wdh-field input[type="file"],
.wdh-field select,
.wdh-field textarea {
  border: none;
  border-bottom: 1px solid var(--wdh-border);
  padding: 6px 2px 10px;
  font-size: 15px;
  color: var(--wdh-text);
  background: transparent;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
  width: 100%;
  resize: vertical;
}

.wdh-field input:focus,
.wdh-field select:focus,
.wdh-field textarea:focus {
  border-color: var(--wdh-blue);
}

.wdh-field input.wdh-invalid,
.wdh-field select.wdh-invalid,
.wdh-field textarea.wdh-invalid {
  border-color: #e5484d;
}

.wdh-upload-status {
  font-size: 12px;
  color: var(--wdh-muted);
}

.wdh-radio-row {
  display: flex;
  gap: 22px;
  align-items: center;
  height: 100%;
}

.wdh-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--wdh-text);
  cursor: pointer;
}

.wdh-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px 16px;
}

.wdh-grid-col-1 {
  grid-template-columns: 1fr;
}

.wdh-grid-col-1 > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.wdh-grid-col-1 > label > img,
.wdh-36 {
  height: 36px;
}

.wdh-grid-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px 16px;
}

.wdh-grid-colors > label {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wdh-grid-colors > label:hover {
  box-shadow: 0 0 10px 0 var(--wdh-blue);
}

.wdh-grid-colors > label:has(input[type="checkbox"]:checked) {
  box-shadow: 0 0 10px 0 var(--wdh-blue);
}

.wdh-grid-colors img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.wdh-grid-colors > label > span {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: white;
}

.wdh-grid-box {
  border: 1px solid var(--wdh-border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}

.wdh-grid-box:has(input[type="checkbox"]:checked) {
  border-color: var(--wdh-blue);
}

.wdh-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--wdh-muted);
}

/* ---------- Coupon code ---------- */
.wdh-coupon-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.wdh-field-grow {
  flex: 1;
  min-width: 220px;
}

.wdh-coupon-apply {
  flex-shrink: 0;
  margin-bottom: 2px;
}

.wdh-coupon-status {
  font-size: 13px;
  margin: 0 0 16px;
  min-height: 18px;
}

.wdh-coupon-status.is-success {
  color: #1b8a4a;
}

.wdh-coupon-status.is-error {
  color: #c62828;
}

/* ---------- Payment type ---------- */
.wdh-payment-type-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.wdh-payment-option {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--wdh-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  position: relative;
}

.wdh-payment-option input {
  position: absolute;
  top: 14px;
  right: 14px;
}

.wdh-payment-option:has(input:checked) {
  border-color: var(--wdh-blue);
  background: rgba(61, 90, 254, 0.05);
}

.wdh-payment-option-title {
  font-weight: 600;
  font-size: 14px;
}

.wdh-payment-option-sub {
  font-size: 12px;
  color: var(--wdh-muted);
}

/* ---------- Price summary ---------- */
.wdh-price-summary {
  border: 1px solid var(--wdh-border);
  border-radius: 12px;
  padding: 16px 20px;
}

.wdh-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  color: var(--wdh-text);
}

.wdh-price-row span:first-child {
  color: var(--wdh-muted);
}

.wdh-price-total {
  border-top: 1px solid var(--wdh-border);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}

.wdh-price-total span:first-child {
  color: var(--wdh-text);
}

.wdh-agreement {
  font-size: 14px;
  color: var(--wdh-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  user-select: none;
}

/* ---------- Summary cards (step 3) ---------- */
.wdh-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.wdh-summary-card {
  border: 1px solid var(--wdh-border);
  border-radius: 12px;
  padding: 16px 18px;
}

.wdh-summary-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--wdh-text);
  letter-spacing: 0.04em;
}

.wdh-summary-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--wdh-muted);
}

.wdh-summary-body div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.wdh-step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  gap: 12px;
}

.wdh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}

.wdh-btn-outline {
  background: #fff;
  border-color: var(--wdh-blue);
  color: var(--wdh-blue);
}

.wdh-btn-outline:hover {
  background: var(--wdh-blue);
  color: white;
}

.wdh-btn-outline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wdh-btn-primary {
  background: var(--wdh-blue);
  color: #fff;
}

.wdh-btn-primary:hover {
  background: var(--wdh-blue-dark);
}

.wdh-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wdh-arrow {
  font-size: 13px;
}

/* ---------- Alerts / errors ---------- */
.wdh-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  width: min(420px, calc(100vw - 40px));
  box-sizing: border-box;
  background: #fff;
  color: #c1121f;
  border: 1px solid #f1b8b8;
  border-left: 4px solid #c1121f;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 8px 28px rgba(20, 22, 35, 0.18);
}

.wdh-alert.wdh-alert-success {
  border-color: #a8d8b8;
  border-left-color: #1a7f37;
  color: #1a7f37;
}

.wdh-alert.wdh-alert-warning {
  border-color: #f1d28a;
  border-left-color: #9a6700;
  color: #7a5200;
}

.wdh-error-banner {
  color: #c1121f;
}

/* ---------- Modal ---------- */
.wdh-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 35, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.wdh-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 30px 34px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.wdh-modal-content h3 {
  margin-top: 0;
  color: #c1121f;
}

#wdh-payment-success-modal .wdh-modal-content h3 {
  color: #1a7f37;
}

.wdh-modal-content .wdh-btn {
  margin-top: 14px;
}

.wdh-secure-note {
  text-align: center;
  font-size: 12px;
  color: var(--wdh-muted);
  margin-top: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .wdh-form-wrap {
    padding: 0 10px;
  }

  .wdh-progress {
    margin-bottom: 30px;
  }

  .wdh-progress-dot {
    width: 16px;
    height: 16px;
  }

  .wdh-card {
    padding: 26px 20px;
  }

  .wdh-grid-2 {
    grid-template-columns: 1fr;
  }

  .wdh-progress-label {
    font-size: 12px;
  }

  .wdh-progress-step {
    width: 100px;
  }

  .wdh-progress-line {
    height: 3px;
    top: 7px;
    width: calc(50% - 50px);
  }

  .wdh-progress-line.left-line {
    margin-left: 50px;
  }

  .wdh-progress-line.right-line {
    margin-right: 50px;
  }

  .wdh-progress-line.full-line {
    margin-inline: 50px;
  }

  .wdh-grid-col-1 > label > img,
  .wdh-36 {
    height: 24px;
  }

  .wdh-grid-colors {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px 10px;
  }

  .wdh-grid-colors > label > span {
    top: 4px;
    left: 6px;
    gap: 6px;
    font-size: 12px;
  }
}
