/* CloudZenixes page shell — matches /billing/login auth design */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --cz-bg: #f4f7fb;
  --cz-surface: #ffffff;
  --cz-border: #dce4f0;
  --cz-text: #0f172a;
  --cz-muted: #64748b;
  --cz-tagline: #94a3b8;
  --cz-accent: #3b82f6;
  --cz-accent-hover: #2563eb;
  --cz-max: 1200px;
  --cz-radius: 18px;
  --cz-input-radius: 12px;
}

:root[data-theme="dark"] {
  --cz-bg: #0f172a;
  --cz-surface: #1e293b;
  --cz-border: #334155;
  --cz-text: #f8fafc;
  --cz-muted: #94a3b8;
  --cz-tagline: #a0aec0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Any author rule that sets `display` beats the browser's own [hidden] rule, so
   a flex or grid element with the attribute would stay on screen without this. */
[hidden] { display: none !important; }

/* Matches the homepage: desktop opens at the equivalent of 80% browser zoom,
   phones stay at full scale. Viewport heights below divide by the factor because
   `zoom` shrinks a 100vh box to 80% of the screen. */
:root { --zoom: 1; }
@media (min-width: 900px) {
  :root { --zoom: 0.8; zoom: var(--zoom); }
}

html { scroll-behavior: smooth; }

body.cz-page-shell {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cz-bg);
  color: var(--cz-text);
  line-height: 1.6;
  min-height: calc(100vh / var(--zoom));
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cz-accent); text-decoration: none; }
a:hover { color: var(--cz-accent-hover); text-decoration: underline; }

.container { max-width: var(--cz-max); margin: 0 auto; padding: 0 1rem; }

/* Minimal auth header (same as /billing/login) */
.cz-shell-header-wrap { padding: 1rem 0 0; }
.cz-auth-header {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 1.5rem;
  z-index: 100;
  width: calc(100% - 1rem);
  max-width: var(--cz-max);
}
.cz-auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--cz-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}
:root[data-theme="dark"] .cz-auth-header-inner {
  background: rgba(30, 41, 59, 0.92);
}
.cz-auth-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.cz-auth-brand:hover { text-decoration: none; }
.cz-auth-brand img, .cz-auth-brand svg { height: 40px; width: auto; flex-shrink: 0; }
.cz-auth-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cz-auth-brand-name { font-size: 1.125rem; font-weight: 800; color: var(--cz-text); }
.cz-auth-brand-tagline {
  font-size: 10px;
  font-weight: 500;
  color: var(--cz-tagline);
  margin-top: 2px;
  white-space: nowrap;
}
.cz-auth-nav { display: none; gap: 1.5rem; align-items: center; }
@media (min-width: 768px) { .cz-auth-nav { display: flex; } }
.cz-auth-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cz-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.cz-auth-nav-link:hover { color: var(--cz-accent); text-decoration: none; }
.cz-shell-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.cz-theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--cz-border);
  background: var(--cz-surface);
  color: var(--cz-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cz-theme-toggle svg { width: 18px; height: 18px; }
.cz-theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .cz-theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .cz-theme-toggle .icon-moon { display: block; }

/* Main + auth card */
.cz-shell-main {
  padding: 7rem 0 3rem;
  min-height: calc(100vh / var(--zoom) - 80px);
}
.cz-auth-card {
  background: var(--cz-surface);
  border: 1px solid var(--cz-border);
  border-radius: var(--cz-radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(59, 130, 246, 0.06);
  padding: 2rem 1.5rem 2.5rem;
  max-width: 420px;
  margin: 0 auto;
}
.cz-auth-card-wide { max-width: 960px; }
.cz-auth-card-xl { max-width: 1100px; }

.cz-auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.cz-auth-head img { height: 40px; max-width: 180px; object-fit: contain; }
.cz-auth-tagline {
  color: var(--cz-tagline);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
}
.cz-auth-title {
  color: var(--cz-text);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 1.25rem;
}
.cz-auth-title-line {
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  margin-top: 0.65rem;
}
.cz-auth-subtitle {
  color: var(--cz-muted);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  max-width: 32rem;
}

/* Forms (match billing login inputs) */
.cz-auth-form label {
  display: block;
  color: #334155;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}
:root[data-theme="dark"] .cz-auth-form label { color: var(--cz-muted); }
.cz-auth-form input,
.cz-auth-form select,
.cz-auth-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  background: var(--cz-surface);
  border: 1px solid var(--cz-border);
  border-radius: var(--cz-input-radius);
  color: var(--cz-text);
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cz-auth-form input::placeholder { color: var(--cz-tagline); }
.cz-auth-form .field-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--cz-tagline);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.5;
}
.cz-auth-form .field-hint.is-ok { color: #15803d; }
.cz-auth-form .field-hint.is-bad { color: #b91c1c; }
:root[data-theme="dark"] .cz-auth-form .field-hint.is-ok { color: #4ade80; }
:root[data-theme="dark"] .cz-auth-form .field-hint.is-bad { color: #f87171; }
.cz-auth-form .field-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
  background: var(--cz-surface-alt, rgba(148, 163, 184, 0.15));
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
}
.cz-auth-form input:focus,
.cz-auth-form select:focus,
.cz-auth-form textarea:focus {
  border-color: var(--cz-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--cz-input-radius);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.cz-btn-primary {
  background: var(--cz-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.cz-btn-primary:hover {
  background: var(--cz-accent-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  text-decoration: none;
  color: #fff;
}
.cz-btn-outline {
  background: transparent;
  border-color: var(--cz-border);
  color: var(--cz-text);
}
.cz-btn-outline:hover {
  border-color: var(--cz-accent);
  color: var(--cz-accent);
  text-decoration: none;
}
.cz-btn-block { width: 100%; }

.cz-auth-footer-text {
  text-align: center;
  color: var(--cz-muted);
  font-size: 0.875rem;
  margin-top: 1.5rem;
}
.cz-auth-link { color: var(--cz-accent); font-weight: 500; }

.cz-shell-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--cz-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--cz-border);
}
.cz-shell-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
}
.cz-shell-footer-links a { color: var(--cz-muted); font-size: 0.8125rem; }
.cz-shell-footer-links a:hover { color: var(--cz-accent); }

/* Checkout layout inside shell */
.checkout-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: 1.2fr 0.85fr; }
}
.cz-panel {
  background: var(--cz-bg);
  border: 1px solid var(--cz-border);
  border-radius: 14px;
  padding: 1.25rem;
}
.cz-panel h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cz-muted);
  margin-bottom: 1rem;
}
.form-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cz-muted);
  margin: 1.25rem 0 0.65rem;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 640px) { .form-row-2 { grid-template-columns: 1fr; } }

/* Details the account already holds, shown back rather than asked for again. */
.identity-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--cz-border);
  border-radius: var(--cz-input-radius);
  background: rgba(59, 130, 246, 0.06);
}
.identity-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--cz-accent);
  color: #fff;
}
.identity-check svg { width: 15px; height: 15px; }
.identity-body { display: flex; flex-direction: column; min-width: 0; }
.identity-name { font-size: 0.95rem; font-weight: 700; line-height: 1.35; }
.identity-meta { color: var(--cz-muted); font-size: 0.85rem; line-height: 1.4; overflow-wrap: anywhere; }
.identity-manage { margin-left: auto; flex: 0 0 auto; font-size: 0.85rem; font-weight: 600; }
.payment-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.checkout-note, .legal-meta { color: var(--cz-muted); font-size: 0.85rem; margin-top: 1rem; }
.register-steps {
  list-style: none;
  counter-reset: register-step;
  display: grid;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}
.register-steps li {
  counter-increment: register-step;
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: 0.15rem 0.75rem;
}
.register-steps li::before {
  content: counter(register-step);
  grid-row: span 2;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cz-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.register-steps strong { color: var(--cz-text); font-size: 0.9rem; }
.register-steps span { color: var(--cz-muted); font-size: 0.82rem; line-height: 1.55; }
.register-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cz-border);
  color: var(--cz-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}
.billing-disclosure {
  background: var(--cz-bg);
  border: 1px solid var(--cz-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.disclosure-title { font-size: 0.88rem; margin-bottom: 0.5rem; font-weight: 600; }
.disclosure-list { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; }
.disclosure-list dt { color: var(--cz-muted); text-transform: capitalize; }
.disclosure-list dd { margin: 0; }
.terms-block { margin: 0.75rem 0; }
.terms-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--cz-muted);
  cursor: pointer;
}
.terms-check input { margin-top: 0.2rem; width: auto; }
.summary-plan { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.summary-specs { list-style: none; color: var(--cz-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.summary-specs li { margin-bottom: 0.25rem; }
.summary-total { font-size: 1.5rem; font-weight: 800; }
.summary-total span { font-size: 0.9rem; color: var(--cz-muted); font-weight: 500; }
.summary-note { font-size: 0.82rem; color: var(--cz-muted); margin-top: 0.5rem; }

/* Stock, where the buyer is deciding: above the total, so a single remaining unit is
   read before the price rather than after it. */
.summary-stock {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.summary-stock::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.summary-stock-in-stock { color: #15803d; }
.summary-stock-low { color: #b45309; }
.summary-stock-sold-out { color: #b91c1c; }

.payment-buttons [data-pay][disabled] { opacity: 0.55; cursor: not-allowed; }

/* Billing terms. Cards rather than a dropdown, because the saving on a longer term
   is the reason to look at all and a collapsed list would hide it. */
.term-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}
.term-option {
  position: relative;
  display: block;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--cz-border);
  border-radius: 12px;
  background: var(--cz-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.term-option:hover { border-color: var(--cz-accent); }
.term-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.term-option-active {
  border-color: var(--cz-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.term-option:focus-within { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); }
.term-option-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.term-option-name { font-size: 0.85rem; font-weight: 600; color: var(--cz-muted); }
.term-option-save {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}
.term-option-price { display: block; font-size: 1.25rem; font-weight: 800; }
.term-option-price small { font-size: 0.75rem; font-weight: 500; color: var(--cz-muted); }
.term-option-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--cz-muted);
}
.term-option-was { opacity: 0.7; }
:root[data-theme="dark"] .term-option-save { color: #4ade80; background: rgba(74, 222, 128, 0.14); }

.checkout-alert {
  max-width: 960px;
  margin: 0 auto 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cz-border);
  font-size: 0.9rem;
}
.checkout-alert--warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.checkout-alert--error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); }

/* Legal page inside shell */
.legal-layout { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .legal-layout { grid-template-columns: 240px 1fr; } }
.legal-nav {
  background: var(--cz-bg);
  border: 1px solid var(--cz-border);
  border-radius: 14px;
  padding: 1rem;
}
.legal-nav h2 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.legal-nav-note { font-size: 0.78rem; color: var(--cz-muted); margin-bottom: 0.75rem; }
.legal-link {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--cz-muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.legal-link:hover, .legal-link.active {
  color: var(--cz-accent);
  background: rgba(59, 130, 246, 0.08);
  text-decoration: none;
}
.legal-content { min-width: 0; }
.legal-body { line-height: 1.65; color: var(--cz-muted); font-size: 0.92rem; }
.legal-pre { white-space: pre-wrap; font-family: inherit; }

/* Success page */
.cz-success-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.cz-success-actions .cz-btn { text-align: center; }
