/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tiktok: #010101;
  --tiktok-red: #fe2c55;
  --tiktok-cyan: #25f4ee;
  --primary: #1a1a2e;
  --accent: #fe2c55;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #f9fafb;
  --card: #ffffff;
  --border: #e5e7eb;
  --success: #059669;
  --error: #dc2626;
  --info: #2563eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.07), 0 12px 32px rgba(0,0,0,.1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: "SF Mono", "Fira Code", monospace; font-size: .875em; background: #f3f4f6; padding: 2px 5px; border-radius: 4px; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: .9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.1);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
}
.brand:hover { opacity: .85; text-decoration: none; }
.brand-icon { font-size: 1.2rem; color: var(--tiktok-cyan); }

.site-nav { display: flex; align-items: center; gap: 1.2rem; }
.site-nav a { color: rgba(255,255,255,.8); font-size: .9rem; text-decoration: none; transition: color .15s; }
.site-nav a:hover { color: #fff; text-decoration: none; }
.site-nav .nav-logout { color: rgba(254, 44, 85, .9); }
.site-nav .nav-logout:hover { color: var(--tiktok-red); }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.site-main { flex: 1; padding: 2.5rem 0 3rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.65);
  padding: 1.4rem 0;
  font-size: .875rem;
}
.site-footer .container { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.footer-links { display: flex; gap: .6rem; align-items: center; }
.footer-links a { color: rgba(255,255,255,.75); transition: color .15s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-sep { color: rgba(255,255,255,.3); }
.footer-copy { color: rgba(255,255,255,.4); font-size: .8rem; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: .8rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: .9rem;
  border: 1px solid transparent;
}
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-tiktok {
  background: var(--tiktok);
  color: #fff;
  box-shadow: 2px 2px 0 var(--tiktok-cyan), -2px -2px 0 var(--tiktok-red);
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: #adb5bd; color: var(--text); }

.tiktok-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 3rem;
}
.hero-badge {
  display: inline-block;
  background: #fef2f2;
  color: var(--accent);
  border: 1px solid #fecaca;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28rem .75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  max-width: 680px;
  margin: 0 auto 1rem;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 2rem;
}

/* ── Features ─────────────────────────────────────────────────────────────── */
.features { padding: 2rem 0 1.5rem; }
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -.01em;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1rem;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 1.6rem; margin-bottom: .6rem; }
.feature-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.feature-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.55; }

/* ── How it works ─────────────────────────────────────────────────────────── */
.how-it-works { padding: 2rem 0; }
.steps { list-style: none; display: flex; flex-direction: column; gap: .9rem; }
.step { display: flex; align-items: flex-start; gap: 1rem; }
.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body { font-size: .95rem; padding-top: .3rem; }
.step-body strong { color: var(--primary); }

/* ── Profile card ─────────────────────────────────────────────────────────── */
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.profile-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f3f4f6;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: .35rem; }
.profile-meta { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: .3rem; }
.badge { font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 12px; }
.badge-connected { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.profile-scope { font-size: .78rem; color: var(--text-muted); font-family: monospace; }
.profile-id { font-size: .78rem; color: var(--text-muted); }

/* ── Upload form ──────────────────────────────────────────────────────────── */
.upload-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.section-desc { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.upload-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .875rem; font-weight: 600; }
.required { color: var(--accent); }
.form-input, .form-textarea {
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .15s;
  background: #fff;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-file {
  font-size: .875rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem;
  cursor: pointer;
  background: #fafafa;
  transition: border-color .15s;
}
.form-file:hover { border-color: var(--accent); }
.form-hint { font-size: .78rem; color: var(--text-muted); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { color: var(--text-muted); margin-top: .3rem; }

/* ── Status pages ─────────────────────────────────────────────────────────── */
.status-page { text-align: center; padding: 3rem 1rem; max-width: 560px; margin: 0 auto; }
.status-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.status-success { background: #f0fdf4; color: var(--success); border: 2px solid #bbf7d0; }
.status-error   { background: #fef2f2; color: var(--error); border: 2px solid #fecaca; }
.status-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; }
.status-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

.status-details {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  text-align: left;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.detail-row { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.detail-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; min-width: 90px; }
.detail-value { font-size: .88rem; word-break: break-all; }
.detail-link { color: var(--accent); }

.error-detail {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  text-align: left;
  font-size: .875rem;
  color: #991b1b;
  word-break: break-all;
  margin-bottom: 1.5rem;
}
.status-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── Legal pages ──────────────────────────────────────────────────────────── */
.legal-page { max-width: 720px; }
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.legal-date { color: var(--text-muted); font-size: .875rem; margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
.legal-page p { margin-bottom: .85rem; font-size: .95rem; line-height: 1.7; }
.legal-page ul { padding-left: 1.4rem; margin-bottom: .85rem; }
.legal-page ul li { font-size: .95rem; line-height: 1.65; margin-bottom: .3rem; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-nav { gap: .8rem; }
  .profile-card { flex-direction: column; align-items: flex-start; }
  .hero { padding: 2rem .5rem; }
}
