/* Checkout, its confirmation, the plan choice on sign-up and the account's billing page */

/* ---------- Plan and period choices (checkout and sign-up) ---------- */
.tf-choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tf-choice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 8px;
}

.tf-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--tf-border);
  background: var(--tf-surface);
  color: var(--tf-text);
  text-decoration: none;
  cursor: pointer;
}

.tf-choice:hover { border-color: var(--tf-border-strong); color: var(--tf-text); }

.tf-choice:has(input:checked) {
  border: 1.5px solid var(--tf-accent);
  background: var(--tf-accent-soft);
}

.tf-choice:has(input:focus-visible) {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

.tf-choice input {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--tf-accent);
}

.tf-choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
}

.tf-choice-title { font-weight: 600; color: var(--tf-ink); }
.tf-choice-note { font-size: 13px; color: var(--tf-muted); }
.tf-choice-price { font-weight: 600; color: var(--tf-ink); white-space: nowrap; }
.tf-choice-link { border-style: dashed; }
.tf-choice-link .tf-choice-price { color: var(--tf-accent-ink); font-weight: 500; }

[data-bs-theme=dark] .tf-choice-link .tf-choice-price { color: var(--tf-accent); }

.tf-signup-plans {
  margin: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 575.98px) {
  .tf-choice { flex-wrap: wrap; }
  .tf-choice-body { flex: 1 1 0; }
  .tf-choice-price { width: 100%; padding-left: 26px; }
}

/* ---------- Checkout frame ---------- */
.tf-checkout { background: var(--tf-bg); }

.tf-checkout-header {
  background: var(--tf-surface);
  border-bottom: 1px solid var(--tf-border);
}

.tf-checkout-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.tf-checkout-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--tf-muted);
}

.tf-checkout-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tf-checkout-steps li > span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tf-border-strong);
  font-size: 12px;
  font-weight: 600;
}

.tf-checkout-steps li[aria-current] { color: var(--tf-ink); font-weight: 600; }
.tf-checkout-steps li[aria-current] > span { background: var(--tf-accent); border-color: var(--tf-accent); color: var(--tf-on-accent); }
.tf-checkout-steps li.is-done > span { background: var(--tf-success-soft); border-color: var(--tf-success-soft); color: var(--tf-success-ink); }

.tf-checkout-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--tf-muted);
}

.tf-checkout-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.tf-checkout-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--tf-muted);
  text-decoration: none;
}

.tf-checkout-title {
  margin: 8px 0 20px;
  font-family: var(--tf-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--tf-ink);
}

.tf-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 991.98px) {
  .tf-checkout-grid { grid-template-columns: 1fr; }
}

.tf-checkout-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tf-checkout-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
}

.tf-checkout-section h2,
.tf-checkout-summary h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--tf-ink);
}

.tf-checkout-section fieldset { margin: 0; padding: 0; border: 0; }

.tf-checkout-hint {
  font-size: 13px;
  color: var(--tf-muted);
}

.tf-checkout-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.tf-checkout-methods span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--tf-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--tf-text);
}

.tf-checkout-summary {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
}

.tf-checkout-product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tf-checkout-product .tf-list-meta { display: block; }

.tf-checkout-product-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-accent-soft);
  color: var(--tf-accent-ink);
}

.tf-checkout-lines,
.tf-checkout-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin: 0;
}

.tf-checkout-lines dt,
.tf-checkout-details dt { font-weight: 400; color: var(--tf-muted); }
.tf-checkout-lines dd,
.tf-checkout-details dd { margin: 0; text-align: right; color: var(--tf-ink); font-variant-numeric: tabular-nums; }

.tf-checkout-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--tf-divider);
  font-size: 18px;
  font-weight: 700;
  color: var(--tf-ink);
}

/* ---------- Confirmation ---------- */
.tf-checkout-done {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tf-checkout-done-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 0 4px;
}

.tf-checkout-details { padding: 16px 24px 20px; }

.tf-checkout-next {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 16px 24px;
  list-style: none;
}

.tf-checkout-next li { display: flex; gap: 12px; align-items: flex-start; }

.tf-checkout-next li > span:first-child {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-accent-soft);
  color: var(--tf-accent-ink);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Plans admin ---------- */
.tf-plans-table .form-control,
.tf-plans-table .input-group { min-width: 96px; }
.tf-plans-table .tf-list-meta { display: block; }

.tf-plans-table th[scope=row] { min-width: 140px; }

/* Tables inside panels line up with the panel's padding */
.tf-panel .table > :not(caption) > * > :first-child { padding-left: 24px; }
.tf-panel .table > :not(caption) > * > :last-child { padding-right: 24px; }

.tf-checkout .form-check-label { color: var(--tf-text); }

/* ---------- Small screens ---------- */
.tf-checkout-mini { display: none; }

@media (max-width: 991.98px) {
  .tf-checkout-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    text-decoration: none;
  }
  .tf-checkout-mini .tf-list-meta { display: block; }
  .tf-checkout-mini-total { font-size: 18px; font-weight: 700; color: var(--tf-ink); white-space: nowrap; }
  .tf-checkout-summary { position: static; }
  .tf-checkout-section,
  .tf-checkout-summary { padding: 16px; }
  .tf-checkout-title { font-size: 24px; }
  .tf-checkout-header-inner { padding: 10px 16px; }
  .tf-checkout-main { padding-top: 16px; }
}

@media (max-width: 575.98px) {
  /* Steps: numbers only, the current step keeps its name */
  .tf-checkout-steps li:not([aria-current]) { font-size: 0; gap: 0; }
  .tf-checkout-steps li:not([aria-current]) > span { font-size: 12px; }
  .tf-checkout-steps { gap: 8px; }
}
