/**
 * Storefront - "ticket stub" style.
 *
 * Layered on /theme.css, which owns the tokens, the base typography and every
 * shared component. This file holds only what is particular to buying: the step
 * rail, the plan tickets, the payment tiles and the receipt upload.
 *
 * The look is paper, not glass: hairline rules and flat surfaces instead of
 * shadows and gradients, a numbered rail across the top of the flow, and plan
 * cards shaped like a torn-off ticket with the price on the stub.
 */

/* ------------------------------------------------------------------ */
/* Hero + step rail                                                    */
/* ------------------------------------------------------------------ */

.hero {
  margin-bottom: 22px;
}

.hero .lead {
  margin-top: 8px;
  max-width: 62ch;
}

/* Three fixed stops, so a buyer always knows how much of the purchase is left
   rather than discovering it one screen at a time. */
.steps {
  display: flex;
  align-items: center;
  margin: 20px 0 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.step-dot {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: none;
  transition: background var(--step), border-color var(--step), color var(--step);
}

.step.on {
  color: var(--ink);
}

.step.on .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.step.done {
  color: var(--ink-2);
}

.step.done .step-dot {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--line-strong);
  margin: 0 10px;
  min-width: 12px;
}

.step-label {
  display: none;
}

@media (min-width: 560px) {
  .step-label {
    display: inline;
  }
}

/* ------------------------------------------------------------------ */
/* Mode switch                                                         */
/* ------------------------------------------------------------------ */

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.seg-btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--step), color var(--step);
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------------------ */
/* Plan tickets                                                        */
/* ------------------------------------------------------------------ */

.plan-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* A plan reads as a ticket: body on one side, price on the stub, a perforated
   rule between them. */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  text-align: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: var(--ink-2);
  padding: 0;
  transition: border-color var(--step), transform var(--step), box-shadow var(--step);
}

.ticket:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* The accent rail runs down the leading edge - the one place the brand colour
   appears on a resting card. */
.ticket::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: var(--rail);
  background: var(--accent);
  opacity: 0.85;
}

.ticket-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ticket-name {
  color: var(--ink);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.5;
}

.ticket-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12.5px;
  font-weight: 600;
}

.ticket-desc {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.75;
}

.ticket-stub {
  position: relative;
  border-inline-start: 1.5px dashed var(--line-strong);
  background: var(--paper-2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 140px;
  text-align: center;
}

.ticket-price {
  color: var(--ink);
  font-weight: 800;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

.ticket-cta {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
}

/* The perforation notches. They sit on the dashed rule and hang past the top
   and bottom edges; the ticket's own overflow:hidden crops them into the half
   circles that make the card read as torn rather than merely divided. */
.ticket-stub::before,
.ticket-stub::after {
  content: '';
  position: absolute;
  inset-inline-start: -8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
}

.ticket-stub::before {
  top: -8px;
}

.ticket-stub::after {
  bottom: -8px;
}

/* ------------------------------------------------------------------ */
/* Chosen-plan summary bar                                             */
/* ------------------------------------------------------------------ */

.summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.summary-name {
  color: var(--ink);
  font-weight: 800;
  font-size: 15.5px;
}

.summary-price {
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
}

/* ------------------------------------------------------------------ */
/* Account lookup note                                                 */
/* ------------------------------------------------------------------ */

.account-note {
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 12px;
}

.account-note.ok {
  color: var(--ok-ink);
  background: var(--ok-soft);
}

.account-note.bad {
  color: var(--danger-ink);
  background: var(--danger-soft);
}

/* ------------------------------------------------------------------ */
/* Payment method tiles                                                */
/* ------------------------------------------------------------------ */

.method-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .method-list {
    grid-template-columns: 1fr 1fr;
  }
}

.method {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  font: inherit;
  color: var(--ink-2);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color var(--step), background var(--step);
}

.method:hover {
  border-color: var(--line-strong);
}

.method.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.method-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 16px;
  line-height: 1;
}

.method.on .method-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.method-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.method-name {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.method-sub {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Pay detail rows (card number, wallet, order code)                    */
/* ------------------------------------------------------------------ */

.pay-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  flex-wrap: wrap;
}

.pay-row + .pay-row {
  border-top: 1px solid var(--line);
}

.pay-row > .label {
  color: var(--ink-3);
  font-size: 13px;
  min-width: 108px;
}

.pay-value {
  color: var(--ink);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.pay-value.big {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.row-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* Receipt upload                                                      */
/* ------------------------------------------------------------------ */

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: border-color var(--step), background var(--step);
}

.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}

.dropzone-title {
  color: var(--ink);
  font-weight: 700;
  font-size: 14.5px;
}

.preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}

.preview img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Credentials                                                         */
/* ------------------------------------------------------------------ */

.cred-panel {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.cred-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.cred-line {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 14px;
}

.cred-line > .label {
  color: var(--ink-3);
  font-size: 12.5px;
  min-width: 76px;
}

.cred-line code {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  word-break: break-all;
}

/* ------------------------------------------------------------------ */
/* Terms                                                               */
/* ------------------------------------------------------------------ */

.terms {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--ink-2);
  font-size: 13px;
}

.terms summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.terms p {
  margin-top: 9px;
  white-space: pre-line;
  line-height: 1.85;
}

@media (prefers-reduced-motion: reduce) {
  .ticket:hover {
    transform: none;
  }
}
