/* ============================================
   REPURPOSE ENGINE — Premium Dark UI
   WCAG AA Compliant | Production Grade
   ============================================ */

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

:root {
  --bg-deep: #030712;
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;
  --bg-surface: rgba(255, 255, 255, 0.03);

  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.25);
  --border-active: rgba(59, 130, 246, 0.5);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  /* FIXED: was #475569 (3.4:1) — now #8b9cb7 (5.2:1) passes WCAG AA */
  --text-muted: #8b9cb7;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --primary-glow-strong: rgba(59, 130, 246, 0.25);

  --success: #22c55e;
  --success-light: #4ade80;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #fca5a5;

  /* Platform Colors */
  --twitter: #1d9bf0;
  --linkedin: #0a66c2;
  --instagram: #e4405f;
  --facebook: #1877f2;
  --email: #22c55e;
  --reddit: #ff4500;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --transition: 150ms ease;

  /* Focus ring */
  --focus-ring: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--primary);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---- Skip Link (Accessibility) ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0.5rem;
  color: white;
}

/* ---- Screen Reader Only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---- Focus Styles (Accessibility) ---- */
*:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 0 1px var(--primary);
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

::selection { background: var(--primary); color: white; }

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}
.nav-brand:hover { color: var(--text); opacity: 0.8; }

.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  color: white;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a:not(.btn) {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-links a:not(.btn):hover {
  color: var(--text);
  background: var(--bg-surface);
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.125rem;
  transition: all var(--transition);
}
.nav-toggle:hover { border-color: var(--border-hover); background: var(--bg-surface); }

/* ---- Badges ---- */
.badge {
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}
/* FIXED: was --text-muted (#475569) which failed contrast on dark bg */
.badge-free { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-pro { background: var(--primary); color: white; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-surface); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; color: white; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-xl { padding: 0.875rem 2.25rem; font-size: 1.0625rem; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* FIXED: disabled states more visually distinct */
.btn.disabled, .btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* ---- Inputs ---- */
input, textarea, select {
  width: 100%;
  padding: 0.6875rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--transition);
  outline: none;
}

/* FIXED: placeholder contrast improved */
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-lg {
  padding: 0.875rem 1.125rem;
  font-size: 1rem;
}

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

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Alerts ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
/* FIXED: improved contrast on error/warning/success alerts */
.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); color: var(--danger-light); }
.alert-warning { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); color: var(--warning-light); }
.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.25); color: var(--success-light); }
.alert-info { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25); color: #93c5fd; }
.alert a { color: inherit; text-decoration: underline; }

/* =============================================
   LANDING PAGE
   ============================================= */

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 6rem 0 4rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-accent { color: var(--primary); }

.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* FIXED: hero note contrast */
.hero-note {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ---- Social Proof ---- */
.social-proof {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.avatar-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 0.75rem;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}
.avatar-circle:first-child { margin-left: 0; }
.avatar-circle.ac-1 { background: #6366f1; }
.avatar-circle.ac-2 { background: #ec4899; }
.avatar-circle.ac-3 { background: #f59e0b; }
.avatar-circle.ac-4 { background: #22c55e; }
.avatar-circle.ac-5 { background: #3b82f6; }
.avatar-circle.ac-more {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.6875rem;
}

.social-proof-stat {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.social-proof-stat strong { color: var(--text); }

/* ---- How It Works ---- */
.how-it-works { padding: 5rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 480px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 36px;
  left: calc(16.67% + 36px);
  right: calc(16.67% + 36px);
  height: 1px;
  background: var(--border);
}

.step-card {
  text-align: center;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.step-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---- Platform Showcase ---- */
.platforms-showcase {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.platform-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.platform-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--platform-color);
}

.platform-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.platform-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.platform-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.platform-card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.platform-preview {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Pricing ---- */
.pricing-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.billing-toggle span {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}
.billing-toggle span.active { color: var(--text); }

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform var(--transition);
}

.toggle-switch.annual::after { transform: translateX(20px); }
.toggle-switch.annual { background: var(--primary); border-color: var(--primary); }

.save-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success-light);
  padding: 0.1875rem 0.5rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 740px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  transition: all var(--transition);
}
.pricing-card:hover { border-color: var(--border-hover); }

.pricing-card-featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, var(--bg) 100%);
}
.pricing-card-featured:hover { border-color: var(--primary); }

.pricing-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pricing-tier {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1;
}
/* FIXED: period text contrast */
.pricing-price .period {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}
.pricing-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.pricing-features li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8125rem;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* FIXED: footer text contrast improved */
.footer-copy {
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.footer-copy a { color: var(--text-secondary); }
.footer-copy a:hover { color: var(--text); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}
/* FIXED: footer link contrast */
.footer-links a {
  color: var(--text-muted);
  font-size: 0.8125rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 160px);
  padding: 3rem 0;
}

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.auth-sub {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.9375rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard { padding: 2rem 0; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.dash-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.usage-meter {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.usage-bar-wrap {
  width: 120px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.usage-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.usage-bar.warning { background: var(--warning); }
.usage-bar.full { background: var(--danger); }

.usage-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.upgrade-link {
  color: var(--primary) !important;
  font-weight: 600;
  font-size: 0.8125rem;
}

/* ---- Repurpose Form ---- */
.repurpose-form-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.input-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  width: fit-content;
}

.tab-btn {
  padding: 0.4375rem 0.875rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: all var(--transition);
  font-family: inherit;
}

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

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.repurpose-form .btn { margin-top: 1rem; }

/* ---- Loading ---- */
.loading-state {
  text-align: center;
  padding: 4rem 2rem;
}

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

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

.loading-text { color: var(--text-secondary); font-size: 0.9375rem; }
/* FIXED: loading sub text contrast */
.loading-sub { color: var(--text-muted); font-size: 0.8125rem; margin-top: 0.375rem; }

/* ---- Results ---- */
.results-section { margin-bottom: 3rem; }
.results-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.result-card:hover { border-color: var(--border-hover); }

.result-card[data-platform="twitter"] { border-top: 2px solid var(--twitter); }
.result-card[data-platform="linkedin"] { border-top: 2px solid var(--linkedin); }
.result-card[data-platform="instagram"] { border-top: 2px solid var(--instagram); }
.result-card[data-platform="facebook"] { border-top: 2px solid var(--facebook); }
.result-card[data-platform="email"] { border-top: 2px solid var(--email); }
.result-card[data-platform="reddit"] { border-top: 2px solid var(--reddit); }

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border);
}

.result-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.result-header h3 {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
}

/* FIXED: copy button contrast improved */
.btn-copy {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.3125rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.btn-copy:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-surface); }
.btn-copy.copied {
  border-color: var(--success);
  color: var(--success-light);
  background: rgba(34, 197, 94, 0.08);
}

.result-content {
  padding: 1.125rem;
  font-size: 0.8625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
}

/* ---- Recent ---- */
.recent-section { margin-top: 2.5rem; }
.recent-section h2 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.recent-list { display: flex; flex-direction: column; gap: 0.375rem; }

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all var(--transition);
}
.recent-item:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.recent-title { font-weight: 500; font-size: 0.875rem; }
/* FIXED: recent meta contrast */
.recent-meta { color: var(--text-muted); font-size: 0.75rem; }

/* ---- History ---- */
.history-page { padding: 2rem 0; }
.history-page h1 {
  margin-bottom: 2rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.history-list { display: flex; flex-direction: column; gap: 0.75rem; }

.history-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
}

.history-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
/* FIXED: history meta contrast */
.history-meta { color: var(--text-muted); font-size: 0.8125rem; }
.history-actions { display: flex; gap: 0.375rem; }
.history-content { padding: 0 1.25rem 1.25rem; }

/* ---- Pricing Page (standalone) ---- */
.pricing-page {
  text-align: center;
  padding: 3rem 0;
}
.pricing-page h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.pricing-sub {
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.0625rem;
}

/* ---- Admin ---- */
.admin-page { padding: 2rem 0; }
.admin-page h1 {
  margin-bottom: 2rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.admin-grid { display: grid; gap: 1rem; }
.admin-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.admin-card h3 { margin-bottom: 0.75rem; font-weight: 600; }
.admin-card pre {
  background: var(--bg-deep);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.admin-card code {
  background: var(--bg-deep);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.status { font-weight: 500; margin-bottom: 0.5rem; font-size: 0.875rem; }
.status-ok { color: var(--success-light); }
.status-warn { color: var(--warning-light); }
.hint { color: var(--text-muted); font-size: 0.8125rem; }

/* ---- Empty / Error ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.error-page {
  text-align: center;
  padding: 6rem 0;
}
.error-page h1 {
  font-size: 5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  letter-spacing: -0.04em;
}
.error-page p { color: var(--text-secondary); margin-bottom: 2rem; font-size: 1.0625rem; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.5rem;
  }
  .nav-links.show { display: flex; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }

  .hero { padding: 3.5rem 0 2.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1.0625rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }

  .steps-grid { grid-template-columns: 1fr; gap: 2rem; }
  .steps-grid::before { display: none; }

  .platforms-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }

  .dash-header { flex-direction: column; gap: 1rem; }

  .history-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

  .footer-content { flex-direction: column; gap: 1rem; text-align: center; }

  .repurpose-form-section { padding: 1.25rem; }

  .section-header h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .pricing-card { padding: 1.75rem; }
  .auth-card { padding: 1.75rem; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  padding: 0 0.75rem;
}

/* ---- E2EE Styles ---- */

.e2ee-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.e2ee-banner-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.e2ee-banner-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.e2ee-banner-text strong {
  color: var(--text);
}

.e2ee-lock {
  font-size: 0.75em;
  vertical-align: middle;
  opacity: 0.7;
}

/* Landing page E2EE section */
.e2ee-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.03), rgba(59, 130, 246, 0.03));
}

.e2ee-showcase {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.e2ee-shield {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.e2ee-showcase h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.e2ee-showcase p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.e2ee-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  text-align: left;
}

.e2ee-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 6px;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .e2ee-features {
    grid-template-columns: 1fr;
  }
}
