/*
  Sepivex — Components
  Reusable UI primitives used across the six approved pages.
*/

/* ---- Eyebrow / section label (from brand guide §hero pattern) ---- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 12px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: inline-block;
}

/* ---- Buttons ----
   Accent reserved for CTAs/links/active-states per brand guide §04 —
   exactly one primary treatment, one secondary treatment. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border-radius: var(--radius-control);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #3255d1; /* darkened accent for hover — derived from --accent */
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--text-secondary);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- CTA band (repeated primary/secondary CTA block used at page ends) ---- */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ---- Card (base surface primitive; brand guide's own card pattern) ---- */

.card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}

.card-raised {
  background: var(--surface-2);
}

/* ---- Diagnose -> Build -> Own -> Continue progression ----
   A genuine sequence (per frontend-design guidance, numbered/staged
   treatment is only appropriate where content really is a sequence —
   this qualifies). Restrained: connecting line + stage cards, no
   gimmicky diagram. */

.progression {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  position: relative;
}

@media (max-width: 900px) {
  .progression { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .progression { grid-template-columns: 1fr; }
}

.progression__stage {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

.progression__index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.progression__stage h3 {
  margin-bottom: 8px;
}

.progression__stage p {
  max-width: none;
}

/* ---- Pricing / retainer comparison ----
   A real comparison structure, not identical unrelated cards —
   shared row labels align across tiers. Flagship tier (Automation
   Ownership) gets the one deliberate accent moment on the page. */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  align-items: stretch;
}

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-tier {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pricing-tier--flagship {
  border-color: var(--accent);
  background: var(--surface-2);
  position: relative;
}

.pricing-tier__badge {
  position: absolute;
  top: -12px;
  left: var(--space-4);
  background: var(--accent);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.pricing-tier__price {
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  letter-spacing: var(--text-h2-tracking);
}

.pricing-tier__period {
  font-size: var(--text-small-size);
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}

.pricing-tier__scope {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border-top: var(--border-width) solid var(--border);
  padding-top: var(--space-2);
}

.pricing-tier__scope-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-small-size);
  color: var(--text-secondary);
}

.pricing-tier__scope-row strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

/* Shared terms listed once beneath the tiers, not repeated per-card
   (mobile-readability decision from the responsive plan). */
.pricing-shared-terms {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--border);
}

.pricing-shared-terms ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.pricing-shared-terms li {
  font-size: var(--text-small-size);
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.pricing-shared-terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  background: var(--text-tertiary);
}

/* ---- FAQ (native <details>/<summary> — no JS required) ---- */

.faq {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: var(--border-width) solid var(--border);
}

.faq-item summary {
  padding: var(--space-3) 0;
  cursor: pointer;
  font-size: var(--text-h3-size);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--text-h3-tracking);
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212"; /* minus sign */
}

.faq-item p {
  padding-bottom: var(--space-3);
  max-width: var(--content-max-width-narrow);
}

/* ---- Forms ---- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.form-group label {
  font-size: var(--text-small-size);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-control {
  background: var(--surface-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  color: var(--text-primary);
  width: 100%;
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea.form-control {
  resize: vertical;
  min-height: 96px;
}

.form-control[aria-invalid="true"] {
  border-color: var(--error);
}

.form-error {
  font-size: 12px;
  color: var(--error);
}

.form-status {
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-size: var(--text-small-size);
  display: none;
}

.form-status[data-state="success"] {
  display: block;
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: var(--border-width) solid rgba(52, 211, 153, 0.25);
}

.form-status[data-state="error"] {
  display: block;
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
  border: var(--border-width) solid rgba(248, 113, 113, 0.25);
}

/* Honeypot field: technical anti-spam only, never a visible 6th field. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Problem-recognition list (not a sequence — no numbering) ---- */

/* Narrow lists/blocks sit under left-aligned headings: keep them on the
   same left edge instead of centring them via .wrap-narrow's auto margins. */
.problem-list.wrap-narrow,
.pricing-shared-terms.wrap-narrow {
  margin-left: 0;
  margin-right: 0;
}

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.problem-list li {
  padding: var(--space-2) 0;
  border-bottom: var(--border-width) solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-body-size);
  line-height: var(--text-body-leading);
}

.problem-list li:last-child {
  border-bottom: none;
}

/* ---- Legal pages (Privacy Policy, Terms of Service) ----
   Long-form prose and one table per page. Scoped entirely under .legal. */

.legal {
  max-width: var(--content-max-width-narrow);
}

.legal h1 {
  margin-bottom: var(--space-2);
}

.legal .legal__updated {
  color: var(--text-secondary);
  font-size: var(--text-small-size);
  margin-bottom: var(--space-4);
}

.legal .legal__updated strong {
  color: inherit;
  font-weight: var(--weight-medium);
}

.legal h2 {
  font-size: var(--text-h3-size);
  letter-spacing: var(--text-h3-tracking);
  line-height: var(--text-h3-leading);
  margin: var(--space-6) 0 var(--space-2);
  scroll-margin-top: var(--space-12);
}

.legal p,
.legal li {
  color: var(--text-secondary);
}

.legal p + p,
.legal ul + p,
.legal .legal__table + p {
  margin-top: var(--space-2);
}

.legal strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.legal ul {
  list-style: disc;
  padding-left: var(--space-3);
  margin: var(--space-2) 0;
}

.legal ul ul {
  list-style: circle;
  margin: var(--space-1) 0 0;
}

.legal li + li {
  margin-top: var(--space-1);
}

.legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal__table {
  overflow-x: auto;
  margin: var(--space-3) 0;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
}

.legal table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: var(--text-body-size);
}

.legal th,
.legal td {
  padding: var(--space-2);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-width) solid var(--border);
}

.legal th {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  background: var(--surface);
}

.legal td {
  color: var(--text-secondary);
}

.legal tbody tr:last-child td {
  border-bottom: none;
}
