/* =============================================================================
   CognitixERP SaaS - public checkout wizard (/start)
   -----------------------------------------------------------------------------
   Loaded AFTER cgx-admin.css so it refines the same components the wizard
   already uses. Everything is scoped under .cgx-checkout (a class the Start
   page puts on its own container), so the console and the signed-in buyer
   portal keep their existing skin. Like the rest of the kit nothing here
   hardcodes a colour except the brand ramp: surfaces, borders and text tones
   read from --mud-palette-* variables, so the wizard is correct in light and
   dark mode alike.
   -----------------------------------------------------------------------------
   The design intent of a funnel is different from the design intent of a
   console: nobody browses a checkout, they decide. So the page is one column,
   centred, with a quiet brand wash behind it, the promise line above the fold
   and every choice drawn as a card the buyer can tap.
 ============================================================================= */

/* ---- the wash -------------------------------------------------------------
   Fixed rather than in-flow, so the tint sits behind the bar and the first
   screen alike and cannot be clipped by the container's own width. */
.cgx-checkout { position: relative; }

.cgx-checkout::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 90% at 18% -8%, color-mix(in srgb, var(--cgx-brand-1) 11%, transparent), transparent 70%),
    radial-gradient(52% 85% at 84% -6%, color-mix(in srgb, var(--cgx-brand-3) 9%, transparent), transparent 70%);
}

.cgx-checkout > * { position: relative; z-index: 1; }

/* ---- the opening ----------------------------------------------------------- */
.cgx-checkout__intro { text-align: center; max-width: 720px; margin: 4px auto 28px; }

.cgx-checkout__overline {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mud-palette-primary);
}

.cgx-checkout .cgx-checkout__title.mud-typography {
  font-size: clamp(1.65rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 8px 0 10px;
}

.cgx-checkout .cgx-checkout__lede.mud-typography {
  color: var(--mud-palette-text-secondary);
  max-width: 58ch;
  margin: 0 auto 16px;
}

.cgx-checkout__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }

.cgx-checkout__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--cgx-radius-pill);
  border: 1px solid var(--mud-palette-lines-default);
  background: color-mix(in srgb, var(--mud-palette-surface) 76%, transparent);
  font-size: .8rem;
  font-weight: 600;
  color: var(--mud-palette-text-secondary);
}

.cgx-checkout__chip .mud-icon-root { color: var(--mud-palette-primary); font-size: 1rem; }

.cgx-checkout__intro .mud-button-root { text-transform: none; font-weight: 600; }

/* ---- the stepper -----------------------------------------------------------
   Dots on a rail, centred: what is done is filled, what is now is ringed, what
   waits is a number. The label of the active step takes the foreground, so the
   eye lands on the name of the question being answered. */
.cgx-checkout .cgx-stepper { display: flex; align-items: flex-start; margin: 6px auto 30px; }

.cgx-checkout .cgx-stepper__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.cgx-checkout .cgx-stepper__item:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--mud-palette-lines-default);
}

.cgx-checkout .cgx-stepper__item--done::before,
.cgx-checkout .cgx-stepper__item--active::before {
  background: color-mix(in srgb, var(--mud-palette-primary) 60%, transparent);
}

.cgx-checkout .cgx-stepper__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--cgx-radius-pill);
  border: 2px solid var(--mud-palette-lines-default);
  background: var(--mud-palette-surface);
  color: var(--mud-palette-text-secondary);
  font-size: .78rem;
  font-weight: 800;
  transition: border-color var(--cgx-tap), box-shadow var(--cgx-tap), background var(--cgx-tap);
}

.cgx-checkout .cgx-stepper__item--done .cgx-stepper__dot {
  border-color: transparent;
  background: var(--cgx-grad);
  color: #fff;
}

.cgx-checkout .cgx-stepper__item--active .cgx-stepper__dot {
  border-color: var(--mud-palette-primary);
  color: var(--mud-palette-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
}

.cgx-checkout .cgx-stepper__label {
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--mud-palette-text-secondary);
}

.cgx-checkout .cgx-stepper__item--active .cgx-stepper__label,
.cgx-checkout .cgx-stepper__item--done .cgx-stepper__label { color: var(--mud-palette-text-primary); }

/* ---- the panel -------------------------------------------------------------
   One bordered sheet per step, no Mud elevation: the wizard is a sequence of
   cards the buyer fills, and a hairline reads calmer than a shadow stack. */
.cgx-checkout .cgx-checkout__panel.mud-paper {
  border: 1px solid var(--mud-palette-lines-default);
  border-radius: var(--cgx-radius-lg);
  box-shadow: var(--cgx-shadow-card);
}

.cgx-checkout .cgx-checkout__panel-title.mud-typography {
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -.015em;
}

.cgx-checkout .cgx-checkout__panel-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 17px;
  border-radius: 4px;
  background: var(--cgx-grad);
  margin-inline-end: 10px;
  vertical-align: -2px;
}

/* ---- inputs -----------------------------------------------------------------
   Outlined fields share one corner and one ink; the label does the work the old
   placeholder-only fields had to guess at. */
.cgx-checkout .mud-input > fieldset.mud-input-outlined-border { border-radius: 10px; }
.cgx-checkout .mud-input-label { font-weight: 600; }
.cgx-checkout .mud-input-helper-text { font-size: .76rem; }

/* ---- buttons -----------------------------------------------------------------
   Filled primary doors wear the same ramp the landing page and the stepper
   already promised, so "continue" looks like the platform's own answer. */
.cgx-checkout .mud-button-root { border-radius: 12px; font-weight: 700; letter-spacing: .01em; text-transform: none; }
.cgx-checkout .mud-button-filled.mud-button-filled-primary {
  background: var(--cgx-grad) !important;
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--cgx-brand-2) 85%, transparent) !important;
}

@media (hover: hover) {
  .cgx-checkout .mud-button-filled.mud-button-filled-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
}

/* The row that carries Back and Continue closes the step off with a hairline,
   so the button reads as the step's verdict, not another field. */
.cgx-checkout .cgx-checkout__nav {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--mud-palette-lines-default);
}

/* ---- plan cards --------------------------------------------------------------
   The chosen card wears a gradient hairline and a faint tint: recognisable from
   across the room, and the facts become chips so a scanner reads limits, not
   paragraphs. */
.cgx-checkout .cgx-plan { padding: 26px 24px 22px; gap: 14px; }

.cgx-checkout .cgx-plan .mud-button-root { min-height: 46px; font-size: .95rem; }

.cgx-checkout .cgx-plan__amount { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.cgx-checkout .cgx-plan__cycle { margin-top: 3px; }

.cgx-checkout .cgx-plan__facts { display: flex; flex-wrap: wrap; gap: 8px; }

.cgx-checkout .cgx-plan__facts li {
  padding: 6px 12px;
  border-radius: var(--cgx-radius-pill);
  background: color-mix(in srgb, var(--mud-palette-background-grey) 55%, var(--mud-palette-surface));
  font-size: .78rem;
  font-weight: 600;
}

.cgx-checkout .cgx-plan__facts li .mud-icon-root { font-size: 1rem; }

.cgx-checkout .cgx-plan__trial {
  background: color-mix(in srgb, var(--mud-palette-success) 12%, var(--mud-palette-surface));
}

.cgx-checkout .cgx-plan--chosen {
  border: 2px solid transparent;
  padding: 25px 23px 21px;
  background:
    linear-gradient(color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface)),
                    color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface))) padding-box,
    var(--cgx-grad) border-box;
  box-shadow: var(--cgx-shadow-lift);
}

/* ---- the review table ---------------------------------------------------------
   Label left in secondary ink, money right in tabular figures, the total row
   tinted so the one number a buyer came for is also the one they can find. */
.cgx-checkout .cgx-review-table { background: transparent; }

.cgx-checkout .cgx-review-table .mud-table-cell {
  border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 65%, transparent);
  padding: 11px 10px;
  font-size: .9rem;
}

.cgx-checkout .cgx-review-table td:first-child { color: var(--mud-palette-text-secondary); font-weight: 600; }
.cgx-checkout .cgx-review-table td:last-child { text-align: end; font-variant-numeric: tabular-nums; }

.cgx-checkout .cgx-review-table tr:has(td strong) .mud-table-cell {
  background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
  border-bottom-color: transparent;
}

.cgx-checkout .cgx-review-table td strong { color: var(--mud-palette-primary); font-size: 1.02rem; }

/* ---- payment methods -----------------------------------------------------------
   Radios as tiles: the whole row is the target, and the chosen row is filled,
   because a 20px dot is not a decision a buyer should have to hunt for. */
.cgx-checkout .cgx-pay { display: grid; gap: 10px; }

.cgx-checkout .cgx-pay .mud-radio {
  border: 1px solid var(--mud-palette-lines-default);
  border-radius: var(--cgx-radius-md);
  padding: 12px 16px;
  background: var(--mud-palette-surface);
  transition: border-color var(--cgx-tap), background var(--cgx-tap), box-shadow var(--cgx-tap);
}

@media (hover: hover) {
  .cgx-checkout .cgx-pay .mud-radio:hover {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 45%, var(--mud-palette-lines-default));
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
  }
}

.cgx-checkout .cgx-pay .mud-radio:has(input:checked) {
  border-color: var(--mud-palette-primary);
  background: color-mix(in srgb, var(--mud-palette-primary) 7%, var(--mud-palette-surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

/* ---- the delivery step ----------------------------------------------------------
   The journey panel is the page's own answer once money has moved, so it shares
   the panel's skin rather than sitting as a loose widget. */
.cgx-checkout .cgx-journey {
  border: 1px solid var(--mud-palette-lines-default);
  border-radius: var(--cgx-radius-lg);
  box-shadow: var(--cgx-shadow-card);
}

/* ---- phone ---------------------------------------------------------------------
   The rail survives one column, so the labels simply shrink; a buyer on a phone
   still has to see that four questions stand between them and the workspace. */
@media (max-width: 600px) {
  .cgx-checkout { padding-inline: 4px; }
  .cgx-checkout__intro { margin-bottom: 22px; }
  .cgx-checkout .cgx-stepper { margin-bottom: 22px; }
  .cgx-checkout .cgx-stepper__dot { width: 26px; height: 26px; font-size: .72rem; }
  .cgx-checkout .cgx-stepper__item:not(:first-child)::before { top: 12px; }
  .cgx-checkout .cgx-stepper__label { font-size: .62rem; }
  .cgx-checkout .cgx-checkout__panel.mud-paper { padding: 18px !important; }
}
