/* Billing page — premium redesign (orders API / cancel forms untouched) */

html[data-theme="light"] .tf-bill-page{
  --bl-bg:#E8EAE8;
  --bl-card:#FFFFFF;
  --bl-border:#D5D8D5;
  --bl-text:#1A1F1C;
  --bl-muted:#66706A;
  --bl-soft:rgba(26,31,28,.045);
  --bl-green:#2F9E63;
  --bl-green-soft:rgba(47,158,99,.1);
  --bl-green-border:rgba(47,158,99,.22);
  --bl-shadow:0 12px 32px rgba(26,31,28,.07);
  --bl-ease:cubic-bezier(.22,1,.36,1);
  --bl-ok:#2F9E63;
  --bl-pending:#B8860B;
  --bl-bad:#C44B4B;
}
html[data-theme="dark"] .tf-bill-page{
  --bl-bg:#121412;
  --bl-card:#1A1C1A;
  --bl-border:rgba(255,255,255,.09);
  --bl-text:#E8ECE9;
  --bl-muted:#9AA39D;
  --bl-soft:rgba(255,255,255,.04);
  --bl-green:#4CAF78;
  --bl-green-soft:rgba(76,175,120,.12);
  --bl-green-border:rgba(76,175,120,.24);
  --bl-shadow:none;
  --bl-ease:cubic-bezier(.22,1,.36,1);
  --bl-ok:#4CAF78;
  --bl-pending:#D4A017;
  --bl-bad:#E07070;
}
.tf-bill-page{
  --bl-bg:#E8EAE8;
  --bl-card:#FFFFFF;
  --bl-border:#D5D8D5;
  --bl-text:#1A1F1C;
  --bl-muted:#66706A;
  --bl-soft:rgba(26,31,28,.045);
  --bl-green:#2F9E63;
  --bl-green-soft:rgba(47,158,99,.1);
  --bl-green-border:rgba(47,158,99,.22);
  --bl-shadow:0 12px 32px rgba(26,31,28,.07);
  --bl-ease:cubic-bezier(.22,1,.36,1);
  --bl-ok:#2F9E63;
  --bl-pending:#B8860B;
  --bl-bad:#C44B4B;
  position:relative;
  overflow-x:hidden;
  background:var(--bl-bg);
  color:var(--bl-text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  padding-top:72px;
  min-height:100vh;
}

html[data-theme="light"] body:has(.tf-bill-page) .site-glow{
  background:linear-gradient(180deg,#F0F1F0,#E8EAE8 50%,#E0E2E0);
}
html[data-theme="dark"] body:has(.tf-bill-page) .site-glow{
  background:
    radial-gradient(circle at 18% 8%,rgba(76,175,120,.08),transparent 32%),
    linear-gradient(180deg,#121412,#161816 55%,#121412);
}
html[data-theme="dark"] body:has(.tf-bill-page) .tf-topbar.topbar,
html[data-theme="dark"] body:has(.tf-bill-page) .tf-topbar.topbar.scrolled{
  background:#121412;
  border-bottom:1px solid rgba(255,255,255,.07);
}
html[data-theme="light"] body:has(.tf-bill-page) .tf-topbar.topbar,
html[data-theme="light"] body:has(.tf-bill-page) .tf-topbar.topbar.scrolled{
  background:#FAFBFA;
  border-bottom:1px solid rgba(23,23,23,.08);
}

.tf-bill-atmosphere{
  pointer-events:none;
  position:absolute;
  inset:0;
  z-index:0;
  overflow:hidden;
}
.tf-bill-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(72px);
  opacity:.48;
}
.tf-bill-orb-a{
  width:min(440px,55vw);height:min(440px,55vw);
  top:-8%;left:-10%;
  background:radial-gradient(circle,rgba(47,158,99,.28),transparent 70%);
  animation:bl-orb 17s ease-in-out infinite alternate;
}
.tf-bill-orb-b{
  width:min(360px,45vw);height:min(360px,45vw);
  right:-8%;top:30%;
  background:radial-gradient(circle,rgba(76,175,120,.14),transparent 70%);
  animation:bl-orb 21s ease-in-out infinite alternate-reverse;
}

.tf-bill-state{
  position:relative;
  z-index:1;
  padding:120px 24px;
  text-align:center;
  color:var(--bl-muted);
}
.tf-bill-state a{color:var(--bl-green);font-weight:700}

.tf-bill-hero{
  position:relative;
  z-index:1;
  padding:clamp(28px,4vw,44px) 0 8px;
}
.tf-bill-hero-inner{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(260px,.8fr);
  gap:clamp(16px,2.5vw,22px);
  align-items:stretch;
}
.tf-bill-eyebrow{
  margin:0 0 10px;
  color:var(--bl-green);
  font-size:11px;
  font-weight:750;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.tf-bill-hero-copy h1,
.tf-bill-head h2{
  margin:0;
  font-family:"Space Grotesk",Inter,system-ui,sans-serif;
  letter-spacing:-.04em;
  line-height:1.08;
}
.tf-bill-hero-copy h1{font-size:clamp(2rem,4vw,2.9rem)}
.tf-bill-lead{
  margin:12px 0 0;
  color:var(--bl-muted);
  font-size:1.02rem;
  line-height:1.5;
  max-width:46ch;
}
.tf-bill-hero-cta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
}

.tf-bill-btn-primary{
  background:var(--bl-green)!important;
  border-color:transparent!important;
  color:#F7FBF8!important;
  border-radius:12px!important;
  font-weight:750!important;
  min-height:46px;
  box-shadow:0 8px 20px rgba(47,158,99,.22)!important;
  transition:transform .2s var(--bl-ease);
}
.tf-bill-btn-primary:hover{transform:translateY(-1px)}
.tf-bill-btn-ghost{
  background:var(--bl-soft)!important;
  border:1px solid var(--bl-border)!important;
  color:var(--bl-text)!important;
  border-radius:12px!important;
  font-weight:700!important;
  min-height:46px;
  box-shadow:none!important;
}
.tf-bill-btn-ghost:hover{border-color:var(--bl-green-border)!important}

.tf-bill-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:16px;
  border:1px solid var(--bl-border);
  border-radius:22px;
  background:
    linear-gradient(160deg,var(--bl-green-soft),transparent 45%),
    var(--bl-card);
  box-shadow:var(--bl-shadow);
}
.tf-bill-stat{
  padding:14px;
  border:1px solid var(--bl-border);
  border-radius:14px;
  background:rgba(255,255,255,.35);
}
html[data-theme="dark"] .tf-bill-stat{background:var(--bl-soft)}
.tf-bill-stat span{
  display:block;
  color:var(--bl-muted);
  font-size:11px;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tf-bill-stat strong{
  display:block;
  margin-top:6px;
  font-family:"Space Grotesk",Inter,system-ui,sans-serif;
  font-size:1.45rem;
  font-weight:700;
  letter-spacing:-.03em;
  color:var(--bl-text);
}
.tf-bill-stat strong.is-ok{color:var(--bl-ok)}
.tf-bill-stat strong.is-pending{color:var(--bl-pending)}

.tf-bill-section{
  position:relative;
  z-index:1;
  padding:clamp(18px,3vw,28px) 0 clamp(48px,7vw,80px);
}
.tf-bill-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.tf-bill-head h2{font-size:clamp(1.4rem,2.4vw,1.85rem)}

.tf-bill-empty{
  display:grid;
  justify-items:start;
  gap:10px;
  padding:clamp(28px,4vw,40px);
  border:1px dashed var(--bl-border);
  border-radius:20px;
  background:var(--bl-soft);
}
.tf-bill-empty-icon{
  display:grid;
  place-items:center;
  width:48px;height:48px;
  border-radius:14px;
  background:var(--bl-green-soft);
  color:var(--bl-green);
  font-size:20px;
  font-weight:800;
}
.tf-bill-empty h3{
  margin:4px 0 0;
  font-family:"Space Grotesk",Inter,system-ui,sans-serif;
  font-size:1.35rem;
  letter-spacing:-.02em;
}
.tf-bill-empty p{
  margin:0 0 6px;
  color:var(--bl-muted);
}

.tf-bill-table-wrap{
  overflow:auto;
  border:1px solid var(--bl-border);
  border-radius:18px;
  background:var(--bl-card);
  box-shadow:var(--bl-shadow);
}
.tf-bill-table{
  width:100%;
  border-collapse:collapse;
  min-width:860px;
}
.tf-bill-table th,
.tf-bill-table td{
  padding:14px 16px;
  text-align:left;
  border-bottom:1px solid var(--bl-border);
  font-size:14px;
  vertical-align:top;
}
.tf-bill-table th{
  color:var(--bl-muted);
  font-size:11px;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:var(--bl-soft);
  white-space:nowrap;
}
.tf-bill-table tr:last-child td{border-bottom:0}
.tf-bill-table tbody tr{transition:background .15s ease}
.tf-bill-table tbody tr:hover{background:var(--bl-soft)}
.tf-bill-order-id{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12.5px;
  color:var(--bl-muted);
  word-break:break-all;
}
.tf-bill-checkout{
  display:grid;
  gap:4px;
}
.tf-bill-checkout a,
.tf-bill-table a{
  color:var(--bl-green);
  font-weight:700;
}
.tf-bill-checkout small{
  display:block;
  color:var(--bl-muted);
  font-size:12px;
  word-break:break-all;
  line-height:1.35;
}
.tf-bill-status{
  display:inline-flex;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  text-transform:capitalize;
  border:1px solid var(--bl-border);
  background:var(--bl-soft);
  color:var(--bl-muted);
}
.tf-bill-status.is-ok{
  color:var(--bl-ok);
  border-color:rgba(47,158,99,.28);
  background:rgba(47,158,99,.1);
}
.tf-bill-status.is-pending{
  color:var(--bl-pending);
  border-color:rgba(184,134,11,.28);
  background:rgba(184,134,11,.1);
}
.tf-bill-status.is-bad{
  color:var(--bl-bad);
  border-color:rgba(196,75,75,.28);
  background:rgba(196,75,75,.1);
}
.tf-bill-cancel{
  border:1px solid rgba(196,75,75,.35)!important;
  background:rgba(196,75,75,.1)!important;
  color:var(--bl-bad)!important;
  border-radius:10px!important;
  padding:7px 10px!important;
  font-weight:750!important;
  font-size:12px!important;
  cursor:pointer;
}
.tf-bill-cancel:hover{background:rgba(196,75,75,.18)!important}
.tf-bill-muted{color:var(--bl-muted)}
.inline-cancel-form{margin:0;display:inline}

.tf-bill-anim{
  opacity:0;
  transform:translateY(14px);
  animation:bl-rise .55s var(--bl-ease) forwards;
  animation-delay:var(--d,0ms);
}

@keyframes bl-rise{to{opacity:1;transform:none}}
@keyframes bl-orb{
  from{transform:translate3d(0,0,0) scale(1)}
  to{transform:translate3d(16px,10px,0) scale(1.06)}
}

@media (max-width:900px){
  .tf-bill-hero-inner{grid-template-columns:1fr}
}
@media (max-width:720px){
  .tf-bill-page{padding-top:64px}
  .tf-bill-hero-cta{flex-direction:column}
  .tf-bill-hero-cta .btn{width:100%}
  .tf-bill-table{min-width:0}
  .tf-bill-table thead{display:none}
  .tf-bill-table,
  .tf-bill-table tbody,
  .tf-bill-table tr,
  .tf-bill-table td{display:block;width:100%}
  .tf-bill-table tr{
    padding:14px 16px;
    border-bottom:1px solid var(--bl-border);
  }
  .tf-bill-table tr:last-child{border-bottom:0}
  .tf-bill-table td{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:8px 0;
    border-bottom:0;
    text-align:right;
  }
  .tf-bill-table td::before{
    content:attr(data-label);
    color:var(--bl-muted);
    font-weight:700;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.06em;
    text-align:left;
    flex:0 0 38%;
  }
  .tf-bill-checkout{justify-items:end}
  .tf-bill-actions-cell{justify-content:flex-end}
}

@media (prefers-reduced-motion:reduce){
  .tf-bill-orb,
  .tf-bill-anim{animation:none!important}
  .tf-bill-anim{opacity:1;transform:none}
  .tf-bill-btn-primary:hover{transform:none!important}
}
