/* ====================================================
   self-hosted.css — styles for /self-hosted.html
   ==================================================== */

/* ---- layout ---- */
.sh-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sh-main {
  flex: 1;
  padding: 2.5rem 1.25rem 4rem;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.sh-hero {
  margin-bottom: 2.25rem;
}

.sh-hero .wb-crumb {
  margin-bottom: 0.5rem;
}

.sh-hero-headline {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.625rem;
  letter-spacing: -0.02em;
}

.sh-hero-sub {
  font-size: 1rem;
  opacity: 0.72;
  margin: 0;
  max-width: 540px;
}

/* ---- tab bar ---- */
.sh-tabstrip {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--wb-border, rgba(0,0,0,.1));
  margin-bottom: 2rem;
}

.sh-tab {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  transition: opacity .15s, border-color .15s;
}

.sh-tab:hover { opacity: 0.85; }
.sh-tab.active {
  opacity: 1;
  border-bottom-color: var(--accent, #0b64ea);
  color: var(--accent, #0b64ea);
}

.sh-panel { display: none; }
.sh-panel.active { display: block; }

/* ---- setup steps ---- */
.sh-steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sh-step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0 0.875rem;
}

.sh-step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent, #0b64ea);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.sh-step-body { min-width: 0; }
.sh-step-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}
.sh-step-body p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.55;
}
.sh-step-body p:last-child { margin-bottom: 0; }

/* code blocks */
.sh-code-block {
  position: relative;
  background: var(--wb-code-bg, #f4f5f7);
  border: 1px solid var(--wb-border, rgba(0,0,0,.09));
  border-radius: 0.5rem;
  padding: 1rem 1.125rem;
  margin: 0.5rem 0;
  overflow-x: auto;
}

.dark .sh-code-block {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
}

.sh-code-block code,
.sh-code-block pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  display: block;
  white-space: pre;
  margin: 0;
}

.sh-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: var(--wb-border, rgba(0,0,0,.08));
  border: 1px solid var(--wb-border, rgba(0,0,0,.12));
  border-radius: 0.3rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity .15s;
}
.sh-copy-btn:hover { opacity: 1; }
.sh-copy-btn.copied { opacity: 1; color: var(--accent, #0b64ea); }

.sh-inline-code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125em;
  background: var(--wb-code-bg, #f4f5f7);
  border: 1px solid var(--wb-border, rgba(0,0,0,.09));
  border-radius: 0.2rem;
  padding: 0.1em 0.35em;
}

.dark .sh-inline-code {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
}

/* prereq badges */
.sh-prereq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.625rem 0;
  list-style: none;
  padding: 0;
}
.sh-prereq-list li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  background: var(--wb-code-bg, #f4f5f7);
  border: 1px solid var(--wb-border, rgba(0,0,0,.09));
  border-radius: 0.35rem;
  padding: 0.25rem 0.625rem;
}
.dark .sh-prereq-list li {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
}
.sh-prereq-list li svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  stroke: var(--accent, #0b64ea);
  fill: none;
}

.sh-note {
  display: flex;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: rgba(11,100,234,.07);
  border: 1px solid rgba(11,100,234,.18);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}
.sh-note svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  stroke: var(--accent, #0b64ea);
  fill: none;
}

/* ---- pricing ---- */
.sh-pricing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sh-pricing-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.sh-period-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.sh-toggle-track {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  background: var(--wb-border, rgba(0,0,0,.15));
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  border: none;
  flex-shrink: 0;
}
.sh-toggle-track.on { background: var(--accent, #0b64ea); }
.sh-toggle-thumb {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1rem;
  height: 1rem;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.sh-toggle-track.on .sh-toggle-thumb {
  transform: translateX(1.125rem);
}

.sh-annual-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(11,100,234,.1);
  color: var(--accent, #0b64ea);
  border-radius: 999px;
  padding: 0.1em 0.45em;
  letter-spacing: 0.02em;
}

/* plans grid */
.sh-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.125rem;
  margin-bottom: 2rem;
}

.sh-plan-card {
  border: 1px solid var(--wb-border, rgba(0,0,0,.1));
  border-radius: 0.75rem;
  padding: 1.375rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}

.sh-plan-card:hover {
  border-color: var(--accent, #0b64ea);
  box-shadow: 0 0 0 1px var(--accent, #0b64ea), 0 4px 16px rgba(11,100,234,.08);
}

.sh-plan-card--popular {
  border-color: var(--accent, #0b64ea);
}

.sh-plan-popular-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent, #0b64ea);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.15em 0.7em;
  white-space: nowrap;
  text-transform: uppercase;
}

.sh-plan-name {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin: 0 0 0.375rem;
}

.sh-plan-price {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.sh-plan-price .currency {
  font-size: 1.1rem;
  font-weight: 600;
  vertical-align: super;
  line-height: 1;
}

.sh-plan-price .period {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.6;
}

.sh-plan-saving {
  font-size: 0.75rem;
  color: #22c55e;
  font-weight: 500;
  margin-bottom: 0.875rem;
  min-height: 1em;
}

.sh-plan-divider {
  border: none;
  border-top: 1px solid var(--wb-border, rgba(0,0,0,.08));
  margin: 0 0 0.875rem;
}

.sh-plan-limits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.sh-plan-limits li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8125rem;
  opacity: 0.85;
  line-height: 1.4;
}

.sh-plan-limits li svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  stroke: var(--accent, #0b64ea);
  fill: none;
}

.sh-plan-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 1.5px solid var(--accent, #0b64ea);
  background: transparent;
  color: var(--accent, #0b64ea);
  transition: background .15s, color .15s;
  margin-top: auto;
}

.sh-plan-btn:hover,
.sh-plan-card--popular .sh-plan-btn {
  background: var(--accent, #0b64ea);
  color: #fff;
}

.sh-plan-loading {
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.5;
  font-size: 0.9rem;
}

.sh-plans-note {
  font-size: 0.8125rem;
  opacity: 0.6;
  text-align: center;
  margin-bottom: 2rem;
}

/* license key box */
.sh-license-info {
  background: var(--wb-code-bg, #f4f5f7);
  border: 1px solid var(--wb-border, rgba(0,0,0,.09));
  border-radius: 0.625rem;
  padding: 1.125rem 1.25rem;
}
.dark .sh-license-info {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.09);
}
.sh-license-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.sh-license-info p {
  font-size: 0.875rem;
  opacity: 0.75;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.sh-license-info p:last-child { margin-bottom: 0; }

/* ---- purchase modal ---- */
.sh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.sh-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sh-modal {
  background: var(--bg, #fff);
  border: 1px solid var(--wb-border, rgba(0,0,0,.1));
  border-radius: 1rem;
  padding: 1.75rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(10px);
  transition: transform .2s;
}

.dark .sh-modal {
  background: #1a1c22;
  border-color: rgba(255,255,255,.1);
}

.sh-modal-backdrop.open .sh-modal {
  transform: translateY(0);
}

.sh-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sh-modal-head h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.sh-modal-plan-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(11,100,234,.1);
  color: var(--accent, #0b64ea);
  border-radius: 999px;
  padding: 0.2em 0.6em;
  white-space: nowrap;
  margin-top: 0.15rem;
}

.sh-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.45;
  padding: 0.2rem;
  flex-shrink: 0;
  transition: opacity .15s;
}
.sh-modal-close:hover { opacity: 0.8; }
.sh-modal-close svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: currentColor;
  fill: none;
}

.sh-form { display: flex; flex-direction: column; gap: 0.875rem; }

.sh-form-row { display: flex; flex-direction: column; gap: 0.3rem; }

.sh-form-row label {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.75;
}

.sh-form-row input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--wb-code-bg, #f4f5f7);
  border: 1px solid var(--wb-border, rgba(0,0,0,.15));
  border-radius: 0.5rem;
  color: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
  outline: none;
}

.dark .sh-form-row input {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
}

.sh-form-row input:focus {
  border-color: var(--accent, #0b64ea);
}

.sh-form-period {
  display: flex;
  gap: 0.5rem;
}

.sh-period-btn {
  flex: 1;
  padding: 0.45rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  border: 1.5px solid var(--wb-border, rgba(0,0,0,.15));
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  transition: border-color .15s, opacity .15s;
}
.sh-period-btn.active {
  border-color: var(--accent, #0b64ea);
  color: var(--accent, #0b64ea);
  opacity: 1;
}

.sh-form-summary {
  background: rgba(11,100,234,.05);
  border: 1px solid rgba(11,100,234,.12);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.825rem;
  line-height: 1.5;
}
.sh-form-summary strong { font-weight: 600; }

.sh-form-error {
  font-size: 0.8125rem;
  color: #ef4444;
  min-height: 1.2em;
  text-align: center;
}

.sh-submit-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent, #0b64ea);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: opacity .15s;
}
.sh-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* footer */
.sh-footer {
  border-top: 1px solid var(--wb-border, rgba(0,0,0,.08));
  padding: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.5;
}

.sh-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
