/* Enrollment payment gate — modal + branded method buttons. */

/* Mid-screen, and never unreachable. Bootstrap 3 top-aligns every dialog, so
   the gate hung under the viewport's top edge with a lake of backdrop below
   it. The dialog becomes a flex box whose min-height is the viewport minus
   Bootstrap's own dialog margins (10px below 768px, 30px above it): a short
   modal — the auth step — is centred inside that full-height box, and a modal
   taller than the viewport — the payment step on a phone — simply outgrows the
   min-height, at which point the centring is a no-op and `.modal`'s scroll
   takes over with the heading still reachable at the top. Centring by
   `align-items` rather than `margin: auto` for exactly that reason: the box
   grows, it is never a fixed-height container that could push its overflow off
   the top. */
.enroll-gate .modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - 20px);
  max-width: 420px;
}

@media (min-width: 768px) {
  .enroll-gate .modal-dialog {
    min-height: calc(100% - 60px);
  }
}

.enroll-gate__content {
  /* A lone flex item shrink-wraps to its content; the panel has to keep the
     dialog's full (capped) width instead. */
  width: 100%;
  border: 0;
  border-radius: 12px;
}

.enroll-gate__header {
  border-bottom: 0;
  /* Air under the heading — the client asked for a clear break between the
     title and the course line, which the shared 15px of .modal-body padding
     alone did not give at H1 scale. */
  padding-bottom: 16px;
}

/* Typography follows the site's heading scale (main.css) rather than inventing
   modal-local sizes: the gate's heading IS the page's h1 for this step, and the
   course + price line is its h2. Both steps render this same header node, so
   the auth and payment steps get the identical caliber for free. */
.enroll-gate__title {
  font-size: 2rem;
  font-weight: 700;
  /* Bootstrap's .modal-title forces 1.42857143; the site's headings run 1.2. */
  line-height: 1.2;
}

.enroll-gate__course {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.enroll-gate__course-name {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
}

.enroll-gate__price {
  font-size: 1.625rem;
  font-weight: 700;
  white-space: nowrap;
}

/* …and the price is dropped back onto the name's baseline. `.money` is an
   inline-flex, so the row's `align-items: baseline` reads its FIRST flex item —
   the half-size "$" hung at the top of the block — not the big digits, which
   sit lower again because they run at line-height 0.85 from the same flex-start
   top. Measured, the digits' baseline lands 0.325em below the block's: the two
   were the same size but visibly stepped, which is what the client saw. Same
   idiom money.css already uses to seat the "$": a relative offset moves paint
   only, so the row's baseline maths — and the widget everywhere else — are
   untouched. */
.enroll-gate__price .money {
  position: relative;
  top: -0.325em;
}

/* All available methods ride ONE row (client, 2026-07). How many there are is
   geo-dependent — the gate renders between one and three gateways per the
   country whitelists — so the columns are equal fractions rather than a fixed
   split, and a single available method still fills the width exactly as before. */
.enroll-gate__methods {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.enroll-gate__form {
  margin: 0;
  /* flex-basis 0 (not auto) so the columns are equal regardless of how long each
     label is; min-width:0 lets them shrink below their content on narrow
     viewports instead of overflowing the modal. */
  flex: 1 1 0;
  min-width: 0;
}

.pay-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* The forms are equal-width flex items that stretch to the row height; the
     button must fill its form or the three tiles end up ragged whenever one
     label wraps to a second line ("Local payment methods"). */
  height: 100%;
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: filter 0.15s ease-in-out, transform 0.05s ease-in-out;
}

.pay-method:hover {
  filter: brightness(0.96);
}

.pay-method:active {
  transform: translateY(1px);
}

.pay-method:focus-visible {
  outline: 2px solid #272639;
  outline-offset: 2px;
}

/* Until the consent box is ticked, the methods are visibly locked. */
.pay-method:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.pay-method__label {
  font-size: 1rem;
  font-weight: 700;
}

.pay-method__caption {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

/* Brand colors. */
.pay-method--stripe {
  background: #635bff;
  color: #fff;
}

.pay-method--paypal {
  background: #003087;
  color: #fff;
}

.pay-method--dlocal {
  background: #11b886;
  color: #fff;
}

.enroll-gate__note {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: #6b6b76;
  text-align: center;
}

.enroll-gate__unavailable {
  margin: 0;
  color: #6b6b76;
  text-align: center;
}

/* In-modal error notice, revealed by enroll-gate.js when a checkout can't open. */
.enroll-gate__error {
  margin-bottom: 16px;
  text-align: center;
}

.enroll-gate__error[hidden] {
  display: none;
}

/* While a payment attempt is in flight, dim + lock the buttons. */
.enroll-gate.is-busy .enroll-gate__methods {
  opacity: 0.6;
  pointer-events: none;
}

/* Legal disclaimer: digital product, immediate access, final sale. Sits at the
   top of the payment step, above the buttons; a bottom margin sets it off from
   the methods below. */
.enroll-gate__disclaimer {
  margin-bottom: 20px;
}

/* The three disclaimer texts run at the site's standard body size (1rem, see
   main.css `body`) — they were set as fine print at 0.72/0.78rem and read as
   unreadable legalese (client). Only the caliber changes: the title and the
   access line stay bold, the paragraph stays grey. */
.enroll-gate__disclaimer-title {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #4a4a55;
}

.enroll-gate__disclaimer-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #8a8a93;
}

/* Access period — glued to the bottom of the disclaimer paragraph, in bold. The
   translatable string carries a <strong> around the day count; the whole line
   reads bold. */
.enroll-gate__disclaimer-access {
  margin: 10px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: #272639;
}

.enroll-gate__disclaimer-access strong {
  font-weight: 700;
}

/* Mandatory consent: one box for the whole gate, right under the terms. */
.enroll-gate__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  font-weight: 400;
  cursor: pointer;
}

.enroll-gate__consent-box {
  flex-shrink: 0;
  margin: 2px 0 0;
}

.enroll-gate__consent-text {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #4a4a55;
}

/* ---- Sub-steps: guests see auth first, then payment is revealed in place ---- */
.enroll-gate__step[hidden] {
  display: none;
}

.enroll-gate__auth-lead {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: #4a4a55;
}

.enroll-gate__auth-error {
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.enroll-gate__auth-error[hidden] {
  display: none;
}

.enroll-gate__auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.enroll-gate__auth-reveal[hidden] {
  display: none;
}

.enroll-gate__auth-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* First / last name sit side by side on the register reveal. */
.enroll-gate__auth-grid {
  display: flex;
  gap: 12px;
}

.enroll-gate__auth-grid .enroll-gate__auth-row {
  flex: 1;
}

.enroll-gate__auth-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a4a55;
}

.enroll-gate__auth-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #d7d7de;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  color: #272639;
}

.enroll-gate__auth-input:focus {
  outline: none;
  border-color: #272639;
  box-shadow: 0 0 0 2px rgba(39, 38, 57, 0.12);
}

.enroll-gate__auth-field-error {
  margin: 0;
  font-size: 0.72rem;
  color: #d9534f;
}

.enroll-gate__auth-field-error:empty {
  display: none;
}

.enroll-gate__auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  font-weight: 400;
  cursor: pointer;
}

.enroll-gate__auth-terms-box {
  flex-shrink: 0;
  margin: 2px 0 0;
}

.enroll-gate__auth-terms-text {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #4a4a55;
}

.enroll-gate__auth-submit {
  margin-top: 4px;
}

/* Divider between the email form and the Google option. */
.enroll-gate__auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #9a9aa3;
  font-size: 0.78rem;
}

.enroll-gate__auth-or::before,
.enroll-gate__auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ececef;
}

.enroll-gate__auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7d7de;
  border-radius: 10px;
  background: #fff;
  color: #3c4043;
  font-weight: 600;
}

.enroll-gate__auth-google:hover {
  background: #f7f7f9;
}

.enroll-gate__auth-google svg {
  flex-shrink: 0;
}

/* While an auth request is in flight, dim + lock the form. */
.enroll-gate.is-busy .enroll-gate__auth-form,
.enroll-gate.is-busy .enroll-gate__auth-google {
  opacity: 0.6;
  pointer-events: none;
}
