/* ================================================================
   CHECKOUT MODAL — Webzline ERP Landing
   ================================================================ */

/* Overlay */
.wzl-checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Modal */
.wzl-checkout-modal {
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  padding: 32px;
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: wzlModalIn 0.25s ease-out;
}

@keyframes wzlModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close button */
.wzl-checkout-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--t3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.wzl-checkout-close:hover { color: var(--t1); }

/* Steps */
.wzl-checkout-step { display: none; }
.wzl-checkout-step.active { display: block; }

/* Title */
.wzl-checkout-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--t1);
}

/* Plan label */
.wzl-checkout-plan-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--blue);
}

/* Inputs */
.wzl-checkout-modal .wzl-step-info > input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.wzl-checkout-modal .wzl-step-info > input:focus {
  border-color: var(--blue);
  outline: none;
}
.wzl-checkout-modal .wzl-step-info > input::placeholder {
  color: var(--t4);
}

/* Message */
.wzl-checkout-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.wzl-checkout-msg-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.wzl-checkout-msg-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Pay button */
.wzl-checkout-pay {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
}

/* Processing spinner */
.wzl-step-processing {
  text-align: center;
  padding: 40px 20px;
}
.wzl-processing-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bdr);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: wzlSpin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes wzlSpin {
  to { transform: rotate(360deg); }
}

/* Success */
.wzl-step-success {
  text-align: center;
  padding: 20px 0;
}
.wzl-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--green, #10b981);
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.wzl-license-key-box {
  background: var(--bg);
  border: 2px dashed var(--blue);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--t1);
  margin: 16px 0;
  user-select: all;
  cursor: pointer;
}
.wzl-license-key-box:hover {
  border-color: var(--purple);
}
.wzl-success-expiry {
  color: var(--t3);
  font-size: 13px;
  margin-bottom: 4px;
}

/* Done button */
.wzl-checkout-done {
  font-size: 15px;
  font-weight: 600;
}

/* ================================================================
   ADD-ON TOGGLES
   ================================================================ */

/* Container */
.wzl-checkout-addons {
  margin: 16px 0 4px;
}
.wzl-addons-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 10px;
}

/* Add-on card */
.wzl-addon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.wzl-addon-card:hover {
  border-color: color-mix(in srgb, var(--blue) 40%, transparent);
}
.wzl-addon-card.selected {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 6%, var(--bg));
  box-shadow: 0 0 0 1px var(--blue);
}

/* Left: icon + info */
.wzl-addon-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.wzl-addon-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wzl-addon-info {
  min-width: 0;
}
.wzl-addon-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.3;
}
.wzl-addon-desc {
  font-size: 11px;
  color: var(--t3);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right: price + toggle */
.wzl-addon-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wzl-addon-price {
  font-size: 12px;
  color: var(--t2);
  text-align: right;
  white-space: nowrap;
}
.wzl-addon-price del {
  color: var(--t4);
  font-size: 11px;
  margin-right: 2px;
}
.wzl-addon-price strong {
  color: var(--green, #10b981);
  font-weight: 700;
}

/* Toggle switch */
.wzl-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.wzl-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  margin: 0;
  padding: 0;
}
.wzl-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bdr);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.25s;
}
.wzl-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.wzl-toggle input:checked + .wzl-toggle-slider {
  background: var(--blue);
}
.wzl-toggle input:checked + .wzl-toggle-slider::before {
  transform: translateX(16px);
}

/* Make entire card clickable for toggle */
.wzl-addon-card:active {
  transform: scale(0.995);
}

/* ================================================================
   ORDER SUMMARY
   ================================================================ */
.wzl-order-summary {
  margin: 12px 0 4px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 10px;
}
.wzl-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wzl-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--t2);
  padding: 4px 0;
}
.wzl-summary-addon {
  font-size: 12px;
  color: var(--t3);
}
.wzl-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--bdr);
}

/* ================================================================
   LIGHT MODE OVERRIDES
   ================================================================ */
body.light .wzl-checkout-modal {
  background: var(--bg2);
  border-color: var(--bdr);
}
body.light .wzl-checkout-modal .wzl-step-info > input {
  background: var(--bg);
  border-color: var(--bdr);
  color: var(--t1);
}
body.light .wzl-addon-card {
  background: var(--bg);
  border-color: var(--bdr);
}
body.light .wzl-addon-card.selected {
  background: color-mix(in srgb, var(--blue) 5%, #fff);
}
body.light .wzl-order-summary {
  background: var(--bg);
  border-color: var(--bdr);
}
body.light .wzl-toggle-slider {
  background: #d1d5db;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 480px) {
  .wzl-checkout-modal {
    padding: 24px 16px;
    border-radius: 12px;
  }
  .wzl-checkout-title { font-size: 18px; }
  .wzl-license-key-box { font-size: 14px; letter-spacing: 1px; }

  .wzl-addon-card {
    padding: 10px;
    gap: 8px;
  }
  .wzl-addon-icon {
    width: 32px;
    height: 32px;
  }
  .wzl-addon-icon svg {
    width: 15px;
    height: 15px;
  }
  .wzl-addon-name { font-size: 12px; }
  .wzl-addon-desc { display: none; }
  .wzl-addon-price { font-size: 11px; }
  .wzl-addon-price del { display: none; }

  .wzl-order-summary { padding: 12px; }
  .wzl-summary-total { font-size: 14px; }
}
