/* 1CCoder Billing — tariffs, checkout and subscription pages.
   Built on the theme's design tokens (themes/1ccoder/assets/custom.css):
   --bg, --bg-weak, --border, --text, --text-weak, --strong, --strong-lift, --accent, --accent-strong,
   --code-bg, --radius, --mono, --sans. Fallbacks keep it readable if the theme is switched. */

.ccb {
  --ccb-warn-bg: #FBEFEC;
  --ccb-warn-border: #EDCDC5;
  --ccb-warn-text: #7A2E22;
  max-width: 1080px;
  margin: 0 auto;
  /* The page template already pads the content area. */
  padding: 0 0 24px;
  color: var(--text, #646262);
}
[data-theme="dark"] .ccb {
  --ccb-warn-bg: #2A1A17;
  --ccb-warn-border: #5A3029;
  --ccb-warn-text: #F0B9AE;
}
.ccb *, .ccb *::before, .ccb *::after { box-sizing: border-box; }
.ccb a:not(.ccb-btn) { color: var(--strong, #201D1D); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Twenty Twenty-Five outlines every focused element with a 2px black box
   (:where(.wp-site-blocks *:focus)), which also shows after a mouse click. Drop it here;
   keyboard focus still gets a visible cue below. */
.ccb a:focus,
.ccb button:focus,
.ccb input:focus,
.ccb summary:focus { outline: none; }
.ccb a:not(.ccb-btn):focus-visible {
  border-radius: 2px;
  background: var(--accent, #F8FAC7);
  box-shadow: 0 0 0 2px var(--accent, #F8FAC7);
}
.ccb .ccb-check input:focus-visible { box-shadow: 0 0 0 3px var(--accent-strong, #E8EC9A); }

/* ------------------------------- Hero ------------------------------------ */
.ccb-hero { text-align: center; }
.ccb-hero .lp-kicker { display: inline-block; margin-bottom: 18px; }
.ccb-title {
  font-family: var(--mono, monospace);
  font-size: clamp(30px, 4.8vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--strong, #201D1D);
  margin: 0 auto 18px;
  max-width: 820px;
}
.ccb-title--sm { font-size: clamp(26px, 3.6vw, 34px); margin: 8px 0 24px; }
.ccb-subtitle { margin: 0 auto 32px; max-width: 580px; font-size: 17px; }

/* ------------------------------- Period toggle --------------------------- */
.ccb-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: 10px;
  background: var(--bg-weak, #F8F7F7);
}
.ccb-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text, #646262);
  font-family: var(--mono, monospace);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.ccb-toggle-btn:hover { color: var(--strong, #201D1D); }
.ccb-toggle-btn[aria-pressed="true"] {
  background: var(--bg, #FDFCFC);
  color: var(--strong, #201D1D);
  box-shadow: 0 0 0 1px var(--border, #D0CFCE), 0 1px 2px rgba(32, 29, 29, .06);
}
.ccb-save {
  padding: 0 6px;
  border: 1px solid var(--accent-strong, #E8EC9A);
  border-radius: 4px;
  background: var(--accent, #F8FAC7);
  color: #201D1D;
  font-size: 12px;
  line-height: 18px;
}

/* ------------------------------- Plan cards ------------------------------ */
.ccb-plans {
  display: grid;
  grid-template-columns: repeat(var(--ccb-cols, 3), minmax(0, 320px));
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
  align-items: stretch;
}
.ccb-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 22px 26px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: var(--radius, 14px);
  background: var(--bg, #FDFCFC);
  transition: border-color .12s ease, transform .12s ease;
}
.ccb-plan:hover { border-color: var(--strong, #201D1D); transform: translateY(-2px); }
.ccb-plan.is-featured {
  border-color: var(--strong, #201D1D);
  box-shadow: 0 30px 60px -40px rgba(32, 29, 29, .45);
}
.ccb-plan.is-featured::before {
  /* accent strip across the top edge */
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 6px;
  border-radius: var(--radius, 14px) var(--radius, 14px) 0 0;
  background: var(--accent-strong, #E8EC9A);
}
.ccb-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  margin-bottom: 12px;
}
.ccb-badge {
  padding: 1px 8px;
  border: 1px solid var(--accent-strong, #E8EC9A);
  border-radius: 4px;
  background: var(--accent, #F8FAC7);
  color: #201D1D;
  font-family: var(--mono, monospace);
  font-size: 12px;
  line-height: 18px;
}
.ccb-plan-name {
  margin: 0 0 6px;
  font-family: var(--mono, monospace);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--strong, #201D1D);
}
.ccb-plan-tagline { margin: 0; font-size: 14px; line-height: 1.5; min-height: 42px; }

.ccb-price { margin: 18px 0 20px; min-height: 66px; }
.ccb-price-variant { display: block; }
.ccb[data-period="month"] .ccb-price-variant[data-for="year"],
.ccb[data-period="year"] .ccb-price-variant[data-for="month"] { display: none; }
.ccb-amount {
  font-family: var(--mono, monospace);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--strong, #201D1D);
  white-space: nowrap;
}
.ccb-amount--label { font-size: 24px; letter-spacing: -0.02em; }
.ccb-per { margin-left: 6px; font-family: var(--mono, monospace); font-size: 14px; color: var(--text-weak, #9A9898); }
.ccb-price-note { display: block; margin-top: 4px; font-family: var(--mono, monospace); font-size: 12px; color: var(--text-weak, #9A9898); }

.ccb-features {
  list-style: none;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border, #D0CFCE);
}
.ccb-features li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.5;
}
.ccb-features li:last-child { margin-bottom: 0; }
.ccb-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--strong, #201D1D);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

/* ------------------------------- Buttons --------------------------------- */
/* Own classes: the theme's .lp-btn--primary carries a download icon. */
.ccb .ccb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: 4px;
  background: transparent;
  color: var(--strong, #201D1D);
  font-family: var(--mono, monospace);
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.ccb .ccb-btn:hover { border-color: var(--strong, #201D1D); background: var(--bg-weak, #F8F7F7); }
.ccb .ccb-btn--primary {
  border-color: var(--strong, #201D1D);
  background: var(--strong, #201D1D);
  color: var(--bg, #FDFCFC);
}
.ccb .ccb-btn--primary:hover { border-color: var(--strong-lift, #302C2C); background: var(--strong-lift, #302C2C); }
.ccb .ccb-btn--wide { width: 100%; padding: 12px 16px; margin-top: 8px; }
.ccb .ccb-btn--sm { padding: 5px 12px; font-size: 13px; line-height: 20px; }
.ccb-plan .ccb-btn { width: 100%; }

/* Paid plans while online payment is closed: inactive button, note on hover / focus / tap. */
.ccb .ccb-btn:disabled,
.ccb .ccb-btn:disabled:hover { cursor: not-allowed; opacity: .45; border-color: var(--border, #D0CFCE); background: transparent; color: var(--strong, #201D1D); }
.ccb .ccb-btn--primary:disabled,
.ccb .ccb-btn--primary:disabled:hover { border-color: var(--strong, #201D1D); background: var(--strong, #201D1D); color: var(--bg, #FDFCFC); }
.ccb-tip { position: relative; display: block; cursor: not-allowed; outline: none; }
.ccb-tip .ccb-btn { pointer-events: none; }
.ccb-tip-text {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--strong, #201D1D);
  color: var(--bg, #FDFCFC);
  font-family: var(--sans, sans-serif);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  pointer-events: none;
}
.ccb-tip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--strong, #201D1D);
}
.ccb-tip:hover .ccb-tip-text,
.ccb-tip:focus .ccb-tip-text,
.ccb-tip:focus-within .ccb-tip-text { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.ccb-tip:focus-visible .ccb-btn { box-shadow: 0 0 0 3px var(--accent-strong, #E8EC9A); }
.ccb .ccb-btn:focus-visible,
.ccb .ccb-toggle-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-strong, #E8EC9A); }

/* ------------------------------- Trust / legal --------------------------- */
.ccb-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  font-family: var(--mono, monospace);
  font-size: 13px;
  color: var(--text-weak, #9A9898);
}
.ccb-trust li::before { content: "+ "; color: var(--text, #646262); }

.ccb-faq { margin-top: 96px; }
.ccb-faq .lp-h2 { text-align: center; margin-bottom: 28px; }

.ccb-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 56px 0 0;
  font-family: var(--mono, monospace);
  font-size: 13px;
}
.ccb .ccb-legal a { color: var(--text-weak, #9A9898); }
.ccb .ccb-legal a:hover { color: var(--strong, #201D1D); }

/* ------------------------------- Notices --------------------------------- */
.ccb-notice {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 12px 16px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: 10px;
  background: var(--bg-weak, #F8F7F7);
  color: var(--strong, #201D1D);
  font-size: 15px;
}
.ccb-notice--ok { border-color: var(--accent-strong, #E8EC9A); background: var(--accent, #F8FAC7); color: #201D1D; }
.ccb-notice--warn { border-color: var(--ccb-warn-border); background: var(--ccb-warn-bg); color: var(--ccb-warn-text); }

/* ------------------------------- Checkout -------------------------------- */
.ccb-checkout { max-width: 520px; margin: 0 auto; }
.ccb-back {
  display: block;
  max-width: 520px;
  margin: 0 auto 28px;
  font-family: var(--mono, monospace);
  font-size: 13px;
}
.ccb .ccb-back { color: var(--text-weak, #9A9898); text-decoration: none; }
.ccb .ccb-back:hover { color: var(--strong, #201D1D); }

.ccb-summary, .ccb-panel {
  padding: 8px 20px 16px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: var(--radius, 14px);
  background: var(--bg, #FDFCFC);
}
.ccb-summary { margin-bottom: 28px; }
.ccb-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border, #D0CFCE);
  font-size: 15px;
}
.ccb-summary-row strong { color: var(--strong, #201D1D); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.ccb-summary-total strong { font-family: var(--mono, monospace); font-size: 20px; letter-spacing: -0.02em; }
.ccb-summary-note { margin: 12px 0 0; font-size: 13px; line-height: 1.55; }

.ccb-form { display: grid; gap: 16px; }
.ccb-field { display: grid; gap: 6px; }
.ccb-field span { font-size: 14px; color: var(--strong, #201D1D); }
.ccb-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: 10px;
  background: var(--bg, #FDFCFC);
  color: var(--strong, #201D1D);
  font: 16px/1.4 var(--sans, sans-serif);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.ccb-field input:focus {
  outline: none;
  border-color: var(--strong, #201D1D);
  box-shadow: 0 0 0 3px var(--accent, #F8FAC7);
}
.ccb-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.ccb-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--strong, #201D1D); }
.ccb-form-note { margin: 0; text-align: center; font-family: var(--mono, monospace); font-size: 12px; color: var(--text-weak, #9A9898); }

/* ------------------------------- Account --------------------------------- */
.ccb--account > .lp-kicker { display: inline-block; }
.ccb-account-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start; }
.ccb-panel { padding: 8px 20px 20px; }
.ccb-panel-title {
  padding: 12px 0 10px;
  font-family: var(--mono, monospace);
  font-size: 13px;
  color: var(--text-weak, #9A9898);
}
.ccb-panel-title::before { content: "// "; }
.ccb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ccb-actions form { margin: 0; }
.ccb-key { display: flex; align-items: center; gap: 10px; }
.ccb-key code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--code-bg, #EFF0F1);
  color: var(--strong, #201D1D);
  font-family: var(--mono, monospace);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.ccb-muted { margin: 14px 0 0; font-size: 14px; color: var(--text-weak, #9A9898); }

.ccb-status {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--border, #D0CFCE);
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-size: 12px;
  line-height: 20px;
  color: var(--strong, #201D1D);
  white-space: nowrap;
}
.ccb-status--ok { border-color: var(--accent-strong, #E8EC9A); background: var(--accent, #F8FAC7); color: #201D1D; }
.ccb-status--warn { border-color: var(--ccb-warn-border); background: var(--ccb-warn-bg); color: var(--ccb-warn-text); }
.ccb-status--muted { color: var(--text-weak, #9A9898); }

.ccb-history { margin-top: 36px; }
.ccb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ccb-table th {
  padding: 8px;
  border-bottom: 1px solid var(--border, #D0CFCE);
  font-family: var(--mono, monospace);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  color: var(--text-weak, #9A9898);
}
.ccb-table td { padding: 11px 8px; border-bottom: 1px solid var(--border, #D0CFCE); color: var(--strong, #201D1D); }

/* ------------------------------- Responsive ------------------------------ */
@media (max-width: 960px) {
  .ccb-plans { grid-template-columns: repeat(2, minmax(0, 320px)); }
}
@media (max-width: 720px) {
  .ccb-account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ccb { padding: 0 0 16px; }
  .ccb-plans { grid-template-columns: minmax(0, 420px); margin-top: 36px; }
  .ccb-plan-tagline, .ccb-price { min-height: 0; }
  .ccb-faq { margin-top: 64px; }
  .ccb-toggle-btn { padding: 7px 12px; }
}
