@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0b0f19;
  --bg-elevated: #111827;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --fb: #1877f2;
  --fb-soft: #eff6ff;
  --tiktok: #fe2c55;
  --tiktok-soft: #fff1f3;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* —— Nav —— */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topnav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-pill.ok {
  background: rgba(5, 150, 105, 0.15);
  color: #6ee7b7;
  border-color: rgba(5, 150, 105, 0.3);
}

.nav-pill.warn {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.3);
}

/* —— Layout —— */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero-banner {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem;
}

.hero-banner h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-banner p {
  color: #94a3b8;
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

.flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.flow-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flow-arrow {
  color: #475569;
  font-size: 0.75rem;
}

/* —— Stats —— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card:nth-child(1) .value { color: var(--fb); }
.stat-card:nth-child(2) .value { color: var(--accent); }
.stat-card:nth-child(3) .value { color: #7c3aed; }
.stat-card:nth-child(4) .value { color: var(--success); }

/* —— Alerts —— */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert::before {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.alert.ok {
  background: var(--success-soft);
  color: #065f46;
  border-color: #a7f3d0;
}

.alert.ok::before {
  content: "✓";
  background: var(--success);
  color: #fff;
}

.alert.bad {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.alert.bad::before {
  content: "!";
  background: var(--danger);
  color: #fff;
}

/* —— Steps —— */
.workflow {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step-card.featured {
  border-color: #a7f3d0;
  box-shadow: 0 0 0 1px #a7f3d0, var(--shadow);
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.step-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.step-card[data-step="1"] .step-badge {
  background: linear-gradient(135deg, #1877f2, #0d65d9);
}

.step-card[data-step="2"] .step-badge {
  background: linear-gradient(135deg, #fe2c55, #ff0050);
}

.step-card[data-step="3"] .step-badge {
  background: linear-gradient(135deg, #059669, #10b981);
}

.step-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.step-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-body {
  padding: 1.35rem 1.5rem;
}

.step-body + .step-body {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.sub-block {
  margin-bottom: 1.25rem;
}

.sub-block:last-child {
  margin-bottom: 0;
}

.sub-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.sub-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tiktok);
}

/* —— Forms —— */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.field-hint strong {
  color: var(--text-secondary);
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.file-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  background: #fff;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}

.file-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-zone input[type="file"] {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.cookies-panel {
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin-bottom: 0;
}

.cookies-panel .field {
  margin-bottom: 0.75rem;
}

.cookies-panel .field:last-of-type {
  margin-bottom: 0;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-block {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.status-chip.ok {
  background: var(--success-soft);
  color: #047857;
}

.status-chip.warn {
  background: var(--warn-soft);
  color: #b45309;
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* —— Publish CTA —— */
.publish-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.publish-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  background: var(--success-soft);
  border-radius: var(--radius-sm);
  border: 1px solid #a7f3d0;
}

.publish-meta div {
  font-size: 0.875rem;
}

.publish-meta strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #047857;
  letter-spacing: -0.02em;
}

/* —— Table —— */
.data-section {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-section-head {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.data-section-head h3 {
  font-size: 1rem;
  font-weight: 700;
}

.data-section-head span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--surface-2);
}

th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover td {
  background: #fafbfc;
}

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

.channel-tag {
  font-weight: 600;
  color: var(--text);
  font-size: 0.8125rem;
}

.video-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  max-width: 320px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.pending { background: #fef3c7; color: #92400e; }
.badge.scheduled { background: #ede9fe; color: #5b21b6; }
.badge.processing { background: #dbeafe; color: #1e40af; }
.badge.published { background: #d1fae5; color: #065f46; }
.badge.failed { background: #fee2e2; color: #991b1b; }

.time-cell {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* —— Footer —— */
.site-footer {
  max-width: 1120px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

/* —— Overlay —— */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(8px);
}

.scan-overlay[hidden] {
  display: none !important;
}

.scan-overlay-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}

.scan-overlay-box strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.scan-overlay-box .muted {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.scan-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— Responsive —— */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-pills {
    display: none;
  }

  .hero-banner {
    padding: 1.25rem 0;
  }

  .flow-strip {
    display: none;
  }

  .step-header,
  .step-body {
    padding: 1.15rem;
  }

  .publish-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 1.25rem 1rem 3rem;
  }

  .stat-card .value {
    font-size: 1.65rem;
  }
}
