/* ==========================================================================
   NZVPN Design System · components.css
   Tabs, TOC, FAQ, Pricing, Server tables, Platform cards, Blog cards, Callout
   ========================================================================== */

/* ---------- Tabs ---------- */
.tabs {
  width: 100%;
}

.tablist {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: 0;
  background: none;
  white-space: nowrap;
  transition: color 0.15s ease;
  min-height: 44px;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.tabpanel {
  padding-top: 24px;
}

.tabpanel[hidden] {
  display: none;
}

/* ---------- TOC / Section Nav ---------- */
.toc-tabs {
  position: sticky;
  top: calc(var(--head-h) + 8px);
  z-index: 30;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  scrollbar-width: none;
}

.toc-tabs::-webkit-scrollbar {
  display: none;
}

.toc-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease;
  min-height: 44px;
}

.toc-tabs a:hover {
  color: var(--text);
}

.toc-tabs a.is-active {
  color: var(--accent-dark);
  font-weight: 600;
}

.toc-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

body:has(.toc-tabs) section[id] {
  scroll-margin-top: calc(var(--head-h) + 56px);
}

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq details[open] {
  border-color: var(--accent);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  min-height: 48px;
}

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

.faq summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.faq .faq-body {
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Pricing Cards ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.plan {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.plan:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.plan.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-soft);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.plan-desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.plan-price {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.plan-price .currency {
  font-size: 18px;
  font-weight: 700;
  vertical-align: super;
  margin-right: 2px;
}

.plan-price .period {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.plan-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.plan-features {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text);
}

.plan-features li svg {
  flex-shrink: 0;
  color: var(--success);
  margin-top: 3px;
}

.plan-cta {
  margin-top: 20px;
}

.plan-cta .btn-main,
.plan-cta .btn-ghost {
  width: 100%;
}

/* ---------- Server Table ---------- */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--tint2);
}

.region-group {
  border-top: 2px solid var(--border);
}

.region-group td {
  background: var(--bg-panel);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.region-group td .region-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.region-group td .region-flag svg {
  flex-shrink: 0;
}

.line-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--tint2);
  color: var(--accent-dark);
}

.line-type.line-iepl {
  background: var(--tint);
  color: var(--accent-deep);
}

.line-type.line-direct {
  background: var(--bg-panel2);
  color: var(--muted);
}

.streaming-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

.streaming-badge svg {
  flex-shrink: 0;
}

/* ---------- Platform Cards ---------- */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.platform-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 24px 16px;
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.platform-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.platform-card svg {
  margin: 0 auto 12px;
  color: var(--muted);
  width: 32px;
  height: 32px;
}

.platform-card:hover svg {
  color: var(--accent-dark);
}

.platform-card .platform-name {
  font-size: 14px;
  font-weight: 600;
}

.platform-card .platform-btn {
  margin-top: 12px;
}

.platform-card .platform-btn a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
  min-height: 36px;
}

.platform-card .platform-btn a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- Blog Cards ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.blog-card-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card .blog-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.blog-card .blog-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.blog-card h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.blog-card p {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.blog-card .blog-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-card .blog-meta a {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- Callout ---------- */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--tint2);
  padding: 16px 20px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 20px 0;
}

.callout p {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.7;
}

.callout.callout-warn {
  border-left-color: var(--warn);
  background: rgba(217, 130, 15, 0.08);
}

.callout.callout-error {
  border-left-color: var(--error);
  background: rgba(214, 69, 69, 0.08);
}

/* ---------- Promo Block ---------- */
.promo-block {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--tint2) 0%, var(--bg) 60%);
  padding: 28px 32px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.promo-block .promo-text {
  flex: 1;
  min-width: 200px;
}

.promo-block .promo-text h3 {
  font-size: 18px;
  font-weight: 700;
}

.promo-block .promo-text p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

.promo-block .promo-cta {
  flex-shrink: 0;
}

/* ---------- Badge / Chip ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--tint2);
  color: var(--accent-dark);
  border: 1px solid var(--tint);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.badge-success {
  background: rgba(30, 158, 106, 0.1);
  border-color: rgba(30, 158, 106, 0.2);
  color: var(--success);
}

.badge.badge-warn {
  background: rgba(217, 130, 15, 0.1);
  border-color: rgba(217, 130, 15, 0.2);
  color: var(--warn);
}

.badge.badge-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Inline Code ---------- */
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Responsive Components ---------- */
@media (max-width: 900px) {
  .plans {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .platform-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .promo-block {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab {
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .toc-tabs a {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ---------- Preview-only helpers (design-preview.html) ---------- */
.preview-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.preview-section:last-child {
  border-bottom: 0;
}

.preview-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 20px;
}

.preview-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.preview-swatch {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.preview-swatch .swatch-color {
  height: 60px;
}

.preview-swatch .swatch-info {
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.preview-type-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.preview-type-row:last-child {
  border-bottom: 0;
}

.preview-type-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 4px;
}

.preview-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.preview-table-demo {
  margin: 16px 0;
}