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

:root {
  --bg: #0a0e1a;
  --glass: rgba(12, 16, 28, 0.75);
  --glass-hover: rgba(20, 26, 45, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(79, 142, 247, 0.3);
  --accent: #4f8ef7;
  --accent-hover: #3b7de8;
  --accent-glow: rgba(79, 142, 247, 0.2);
  --success: #48bb78;
  --danger: #fc8181;
  --warning: #f6ad55;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #4a5568;
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/img/background.jpg") center/cover no-repeat;
  filter: brightness(0.3) saturate(0.8);
  transform: scale(1.05);
}

/* ─── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 60px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: var(--accent);
}

.brand-icon {
  font-size: 20px;
}

/* ─── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 12px;
}

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

.tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.tab.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ─── User Area ───────────────────────────────────────────── */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--accent);
}

.pill {
  background: rgba(79, 142, 247, 0.15);
  border: 1px solid var(--border-accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.btn-login {
  background: linear-gradient(135deg, #5865F2, #7289DA);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(88, 101, 242, 0.3);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.5);
}

.btn-logout-portal {
  background: rgba(252, 129, 129, 0.15);
  color: var(--danger);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(252, 129, 129, 0.2);
  transition: all 0.2s;
}

.btn-logout-portal:hover {
  background: rgba(252, 129, 129, 0.25);
}

.hidden {
  display: none !important;
}

/* ─── Container ───────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 16px 60px;
}

/* ─── Pages ───────────────────────────────────────────────── */
.page {
  display: none;
  animation: fadeIn 0.25s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Hero Card ───────────────────────────────────────────── */
.hero-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 50px 30px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.hero-card h1 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #4f8ef7, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hero-card .subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-hero:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ─── Form Card ───────────────────────────────────────────── */
.form-card,
.content-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.form-card h2,
.content-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 18px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row>* {
  flex: 1;
}

textarea,
input,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

select {
  cursor: pointer;
}

select option {
  background: #1a2235;
  color: var(--text);
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-submit:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 20px;
}

/* ─── Content Card ────────────────────────────────────────── */
.content-body {
  margin-top: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: pre-wrap;
}

.content-body h1,
.content-body h2,
.content-body h3 {
  color: var(--text);
  margin: 16px 0 8px;
}

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  .tabs {
    order: 3;
    width: 100%;
    margin: 0;
    padding-bottom: 4px;
  }

  .tab {
    font-size: 12px;
    padding: 6px 10px;
  }

  .brand {
    font-size: 12px;
  }

  .user-area {
    font-size: 12px;
  }

  .hero-card {
    padding: 30px 18px;
  }

  .hero-card h1 {
    font-size: 24px;
  }

  .form-card,
  .content-card {
    padding: 20px 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .container {
    margin: 16px auto;
  }

  #userName {
    display: none !important;
  }
}

/* ─── TikTok Section ──────────────────────────────────────── */
.tiktok-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.tiktok-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tiktok-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #010101, #69C9D0);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(105, 201, 208, 0.3);
}

.tiktok-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.tiktok-handle {
  font-size: 13px;
  color: var(--text-secondary);
}

.tiktok-follow-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #EE1D52, #69C9D0);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(238, 29, 82, 0.3);
}

.tiktok-follow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(238, 29, 82, 0.5);
}

.tiktok-embed-wrap {
  display: flex;
  justify-content: center;
  min-height: 500px;
}

.tiktok-embed-wrap iframe {
  border-radius: 12px !important;
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 768px) {
  .tiktok-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .tiktok-follow-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}