/* KOB Payment Layout — scoped to the Stripe self-pay card ONLY.
   Targets: #kob-card-embed, #kob-card-element, #kob-pay-book-btn, .kob-pay-btn.
   Does NOT touch .kob-checkout-panel, .kob-selfpay-form generally,
   or any existing rules. Safe, additive stylesheet.
   Created 2026-11-02. */

/* ---- 1. Outer container: auto width, centered, fits screen ---- */
#kob-card-embed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 520px;          /* comfortable reading width on desktop */
  margin: 18px auto 0;
  padding: 18px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
}

/* Hide the container entirely until Stripe has actually mounted,
   so an empty white box doesn't flash on Step 4. The mount block
   sets a child (iframe) once ready. */
#kob-card-embed:empty {
  display: none;
}

/* ---- 2. Stripe Element mount target: clean modern box ---- */
#kob-card-element,
#kob-card-embed .kob-card-element {
  min-height: 46px;
  padding: 12px 14px;
  border: 1.5px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#kob-card-element.StripeElement--focus,
#kob-card-element:focus-within,
#kob-card-embed .kob-card-element.StripeElement--focus {
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}

#kob-card-element.StripeElement--invalid,
#kob-card-element.ppcp-field-invalid {
  border-color: #b00020;
  box-shadow: 0 0 0 3px rgba(176,0,32,.08);
}

/* ---- 3. Pay button: inline with card, justify, auto width ---- */
/* NOTE: the button has inline style="width:100%" in JS (line 4081).
   We override with !important here — CSS-only, no JS edit. */
#kob-pay-book-btn, .kob-pay-btn {
  width: 100% !important;      /* matches the card width, stacked */
  margin: 0 !important;         /* remove the inline margin-top:14px */
  height: 48px;
  padding: 0 20px;
  background: #111;
  color: #fff;
  border: 1.5px solid #111;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease, transform .05s ease;
}

#kob-pay-book-btn, .kob-pay-btn:hover:not(:disabled) {
  background: #000;
}

#kob-pay-book-btn, .kob-pay-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#kob-pay-book-btn, .kob-pay-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: #6b7280;
  border-color: #6b7280;
}

/* ---- 4. Desktop: card + button on one row, justified ---- */
@media (min-width: 601px) {
  #kob-card-embed {
    display: grid;
    grid-template-columns: 1fr auto;  /* card takes space, button fits */
    align-items: center;
    gap: 12px;
  }

  #kob-card-element {
    grid-column: 1;
  }

  #kob-pay-book-btn, .kob-pay-btn {
    grid-column: 2;
    width: auto !important;          /* shrink to content on desktop */
    min-width: 160px;
    height: 46px;
    padding: 0 22px;
    white-space: nowrap;
  }
}

/* ---- 5. Small screens: stack, full width, comfortable ---- */
@media (max-width: 600px) {
  #kob-card-embed {
    max-width: 100%;
    margin: 12px 0 0;
    padding: 14px;
    border-radius: 12px;
  }

  #kob-pay-book-btn, .kob-pay-btn {
    height: 50px;                    /* easier tap target */
    font-size: 16px;
  }
}
