/* ---- Utility ---- */
.zhsub--hidden {
  display: none !important;
}

/* ---- Page wrapper ---- */
.zhsub-checkout-page {
  padding: 2em var(--minimum-content-padding, 1.5rem) 4em;
  min-height: 100vh;
  box-sizing: border-box;
}

/* ---- Back breadcrumb ---- */
.zhsub-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.875em;
  color: rgba(43, 43, 43, 0.6);
  text-decoration: none;
  margin-bottom: 1.25em;
  transition: color 0.15s;
}

.zhsub-back-link:hover {
  color: #193133;
}

/* ---- Step indicator ---- */
.zhsub-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5em;
}

.zhsub-steps__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
}

.zhsub-steps__bubble {
  width: 2.25em;
  height: 2.25em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875em;
  font-weight: 600;
  border: 2px solid rgba(233, 232, 228, 0.8);
  background: #fff;
  color: rgba(43, 43, 43, 0.5);
  transition:
    background var(--duration-normal, 0.25s),
    border-color var(--duration-normal, 0.25s),
    color var(--duration-normal, 0.25s);
}

.zhsub-steps__step.is-active .zhsub-steps__bubble {
  background: #193133;
  border-color: #193133;
  color: #d0ff71;
}

.zhsub-steps__label {
  font-size: 0.8125em;
  color: rgba(43, 43, 43, 0.5);
  font-weight: 500;
}

.zhsub-steps__step.is-active .zhsub-steps__label {
  color: #2b2b2b;
  font-weight: 700;
}

.zhsub-steps__step.is-clickable {
  cursor: pointer;
}

.zhsub-steps__step.is-clickable .zhsub-steps__bubble {
  border-color: rgba(25, 49, 51, 0.35);
  transition:
    background var(--duration-normal, 0.25s),
    border-color var(--duration-normal, 0.25s),
    color var(--duration-normal, 0.25s);
}

.zhsub-steps__step.is-clickable:hover .zhsub-steps__bubble {
  background: rgba(25, 49, 51, 0.07);
  border-color: #193133;
}

.zhsub-steps__line {
  flex: 1;
  max-width: 5em;
  min-width: 2em;
  height: 2px;
  background: rgba(233, 232, 228, 0.8);
  margin-bottom: 1.4em;
}

/* ---- Two-column layout ---- */
.zhsub-checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5em;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}

.zhsub-checkout__sidebar {
  order: -1;
}

@media (min-width: 761px) {
  .zhsub-checkout {
    grid-template-columns: 1fr 320px;
  }
  .zhsub-checkout__sidebar {
    order: 0;
  }
}

/* ---- Form cards ---- */
.zhsub-form__card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(233, 232, 228, 0.8);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  margin-bottom: 1em;
}

/* h2 inherits PP Frama from theme; just set size/weight */
.zhsub-form__card-title {
  font-size: 1.375em;
  margin: 0 0 1.25em;
}

.zhsub-form__spacer {
  height: 1em;
}

.zhsub-form__divider {
  border: none;
  border-top: 1px solid currentColor;
  opacity: 0.12;
  margin: 1.25em 0;
}

/* ---- Fields ---- */
.zhsub-form__field {
  margin-bottom: 1em;
}

.zhsub-form__field--inline {
  display: flex;
  align-items: center;
  gap: 1em;
}

.zhsub-form__label {
  display: block;
  font-size: 0.875em;
  font-weight: 500;
  color: rgba(43, 43, 43, 0.7);
  margin-bottom: 0.4em;
}

.zhsub-form__field--inline .zhsub-form__label {
  margin-bottom: 0;
}

.zhsub-form__optional {
  font-weight: 400;
  color: rgba(43, 43, 43, 0.45);
}

/* ---- Inputs — font: inherit comes from theme reset ---- */
.zhsub-form__input,
.zhsub-form__select,
.zhsub-checkout .form-control {
  display: block;
  width: 100%;
  padding: 0.75em 1em;
  background: #f8f8f7;
  border: 1.5px solid #f2f0ef;
  color: #252c3e;
  box-sizing: border-box;
  transition:
    border-color var(--duration-normal, 0.25s),
    background var(--duration-normal, 0.25s);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 50px;
}

.zhsub-form__input::placeholder,
.zhsub-checkout .form-control::placeholder {
  color: rgba(43, 43, 43, 0.35);
}

.zhsub-form__input:focus,
.zhsub-form__select:focus,
.zhsub-checkout .form-control:focus {
  outline: none;
  background: #fff;
  border-color: #193133;
  border-color: #2eb79f;
  box-shadow: 0px 0px 2px 0px #2eb79f;
  border-width: 1px;
}

.zhsub-form__select {
  padding-right: 2.5em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23252c3e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
}

.zhsub-form__select--auto {
  width: auto;
}

/* ---- Google Places address autocomplete ----
   Input styling comes from .zhsub-form__input (shared with all form inputs).
   .zhsub-autocomplete-input is kept as a hook for the error-state rule below. ---- */

/* Override Google's pac-container dropdown to match form styling */
.pac-container {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(43, 43, 43, 0.1);
  margin-top: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
}

.pac-item {
  padding: 0.55em 1em;
  border-top: none;
  color: #2b2b2b;
  cursor: pointer;
  line-height: 1.4;
}

.pac-item:hover,
.pac-item-selected {
  background: #e9e8e4;
}

.pac-item-query {
  font-size: inherit;
  color: #252c3e;
}

.pac-matched {
  font-weight: 600;
}

/* ---- Grid rows ---- */
.zhsub-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75em;
}

@media (min-width: 1024px) {
  .zhsub-form__row {
    grid-template-columns: 1fr 1fr;
  }
  .zhsub-form__row--thirds {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ---- Checkbox ---- */
.zhsub-form__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55em;
  cursor: pointer;
  line-height: 1.5;
  color: rgba(43, 43, 43, 0.8);
}

.zhsub-form__checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.2em;
  width: 1.1em;
  height: 1.1em;
  background-color: #193133;
}

/* ---- Cart panel ---- */
.zhsub-cart-panel {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(233, 232, 228, 0.8);
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

@media (min-width: 761px) {
  .zhsub-cart-panel {
    position: sticky;
    top: 1.5em;
  }
}

/* h2 inherits PP Frama */
.zhsub-cart-panel__heading {
  font-size: 1.375em;
  margin: 0 0 1.25em;
}

.zhsub-cart-panel__plan-name {
  font-weight: 700;
  margin: 0 0 0.2em;
}

.zhsub-cart-panel__plan-meta {
  font-size: 0.8125em;
  color: rgba(43, 43, 43, 0.5);
  margin: 0 0 0.5em;
}

.zhsub-cart-panel__plan-price {
  font-size: 1.75em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 1em;
}

.zhsub-cart-panel__breakdown {
  margin-bottom: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.zhsub-cart-panel__line {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  font-size: 0.8125em;
  color: rgba(43, 43, 43, 0.6);
}

.zhsub-cart-panel__line-dots {
  flex: 1;
  border-bottom: 1.5px dotted rgba(43, 43, 43, 0.2);
  margin-bottom: 0.25em;
  min-width: 1em;
}

.zhsub-cart-panel__line-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Coupon note ---- */
.zhsub-cart-panel__coupon-note {
  font-size: 0.8rem;
  color: rgba(43, 43, 43, 0.5);
  margin: 0 0 0.5em;
}

/* ---- Divider ---- */
.zhsub-cart-panel__divider {
  border: none;
  border-top: 1px solid #e9e8e4;
  margin: 1em 0;
}

/* ---- Total row ---- */
.zhsub-cart-panel__total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5em;
  margin-bottom: 0.35em;
}

.zhsub-cart-panel__total-label {
  font-weight: 600;
}

.zhsub-cart-panel__price-amount {
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.zhsub-cart-panel__total-sub {
  font-size: 0.8em;
  color: rgba(43, 43, 43, 0.5);
  margin: 0 0 1.25em;
}

/* ---- Error ---- */
.zhsub-cart-panel__errors {
  font-size: 0.875em;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 8px;
  padding: 0.6em 0.875em;
  margin-bottom: 0.875em;
}

.zhsub-form__validation-note {
  font-size: 0.875em;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 8px;
  padding: 0.6em 0.875em;
  margin: 0 0 0.75em;
}

input.zhsub--field-error,
select.zhsub--field-error {
  border-color: #c0392b !important;
  background: rgba(192, 57, 43, 0.04) !important;
}

.zhsub--field-error .zhsub-autocomplete-input {
  border-color: #c0392b !important;
  background: rgba(192, 57, 43, 0.04) !important;
}

label.zhsub--field-error {
  color: #c0392b;
}

/* ---- Continue button — LR primary style ---- */
.zhsub-cart-panel__continue {
  display: block;
  width: 100%;
  padding: 0.875em 1.5em;
  font-weight: 600;
  cursor: pointer;
  background: #193133;
  color: #d0ff71;
  border: none;
  border-radius: 1.375rem;
  text-align: center;
  margin-bottom: 1em;
  transition: background var(--duration-normal, 0.25s);
  letter-spacing: 0.01em;
}

.zhsub-cart-panel__continue:hover {
  background: #0b413c;
}

.zhsub-cart-panel__continue:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Secure note ---- */
.zhsub-cart-panel__secure {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8em;
  color: rgba(43, 43, 43, 0.5);
  margin: 0;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

.zhsub-cart-panel__secure-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

/* ---- Ancillary providers note ---- */
.zhsub-cart-panel__ancillary-note {
  margin: 1.5em 0 0;
  font-size: 1em;
  line-height: 1.5;
  color: #2b2b2b;
  padding-top: 1em;
  border-top: 1px solid #e9e8e4;
}

.zhsub-cart-panel__ancillary-note p {
  margin: 0 0 0.5em;
}

.zhsub-cart-panel__ancillary-note p:last-child {
  margin-bottom: 0;
}

/* ---- Bottom CTA (inside form) ---- */
.zhsub-form__cta-row {
  margin-top: 0.5em;
}

/* ---- Payment iframe (step 2) ---- */

.zhsub-payment-frame__iframe {
  width: 100%;
  min-height: 600px; /* shown before first postMessage height arrives */
  height: 600px;
  border: none;
  border-radius: 10px;
  background: #fff;
  display: block;
  transition: height 0.2s ease;
}

/* ---- Complete (step 3) ---- */
.zhsub-complete {
  max-width: 480px;
  margin: 0 auto;
  padding: 2em 0;
}

.zhsub-complete__card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(233, 232, 228, 0.8);
  overflow: hidden;
  text-align: center;
}

.zhsub-complete__card-body {
  padding: clamp(2rem, 2rem + 2vw, 3.5rem);
}

.zhsub-complete__icon {
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: #193133;
  color: #d0ff71;
  font-size: 1.5em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25em;
}

.zhsub-complete__heading {
  font-size: 1.75em;
  margin: 0 0 0.5em;
}

.zhsub-complete__body {
  color: rgba(43, 43, 43, 0.6);
  margin: 0;
  line-height: 1.6;
}

.zhsub-complete__training {
  margin: 1em 0 0;
  font-size: 0.9375em;
}

/* Receipt footer — full-width bleed inside card */
.zhsub-complete__summary {
  border-top: 1px solid rgba(233, 232, 228, 0.8);
  background: rgba(243, 242, 238, 0.4);
  text-align: left;
  font-size: 0.875rem;
}

/* Line items */
.zhsub-receipt__items {
  padding: 0.5rem 1.5rem 0.25rem;
}

.zhsub-receipt__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(233, 232, 228, 0.6);
}

.zhsub-receipt__row:last-child {
  border-bottom: none;
}

.zhsub-receipt__label {
  color: rgba(43, 43, 43, 0.75);
}

.zhsub-receipt__amount {
  color: #2b2b2b;
  white-space: nowrap;
}

.zhsub-receipt__row--discount .zhsub-receipt__label,
.zhsub-receipt__row--discount .zhsub-receipt__amount {
  color: #177a4d;
}

.zhsub-receipt__row--plan .zhsub-receipt__label,
.zhsub-receipt__row--plan .zhsub-receipt__amount {
  font-size: 1rem;
  color: #2b2b2b;
  font-weight: 500;
}

.zhsub-receipt__row--tax .zhsub-receipt__label,
.zhsub-receipt__row--tax .zhsub-receipt__amount {
  font-size: 0.75rem;
  color: rgba(43, 43, 43, 0.55);
}

/* Total row */
.zhsub-receipt__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid rgba(233, 232, 228, 0.8);
  font-weight: 600;
}

.zhsub-receipt__total-label {
  color: rgba(43, 43, 43, 0.7);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.zhsub-receipt__total-amount {
  font-size: 1.05rem;
  color: #193133;
}

/* Meta rows (next renewal, card) */
.zhsub-receipt__meta {
  border-top: 1px solid rgba(233, 232, 228, 0.8);
  padding: 0.6rem 1.5rem;
}

.zhsub-receipt__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
}

.zhsub-receipt__meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(43, 43, 43, 0.45);
  white-space: nowrap;
}

.zhsub-receipt__meta-value {
  color: #2b2b2b;
  text-align: right;
}

/* ---- Dev fill button ---- */
.zhsub-dev-fill-row {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  margin-bottom: 0.25em;
}

.zhsub-dev-fill {
  display: inline-block;
  margin-bottom: 0;
  padding: 0.4em 0.875em;
  background: #fff8c5;
  border: 1px dashed #b49000;
  border-radius: 6px;
  color: #7a5c00;
  font-size: 0.8125em;
  font-weight: 600;
  cursor: pointer;
}
.zhsub-dev-fill:hover {
  background: #fff0a0;
}
