/* ── CSS Variables ───────────────────────────────────────────────── */
:root {
  --red: #e02020;
  --red-deep: #b01414;
  --red-glow: rgba(224, 32, 32, 0.18);

  /* Dark theme (default) */
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --text-2: #a0a0a0;
  --text-3: #606060;
  --accent: var(--red);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #f2f2f2;
  --bg-3: #e8e8e8;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --border: #ddd;
  --text: #0a0a0a;
  --text-2: #444;
  --text-3: #888;
  --accent: var(--red);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
  line-height: 1.6;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--red);
  line-height: 1;
}

.brand-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  color: var(--text);
}

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

.nav-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
}
.nav-link:hover { color: var(--text); background: var(--bg-3); }

.nav-cta {
  background: var(--red);
  color: #fff !important;
  border-radius: 4px;
}
.nav-cta:hover { background: var(--red-deep) !important; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.nav-name {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

.nav-logout { color: var(--text-3) !important; font-size: 0.78rem; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  margin-left: 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--red); color: var(--red); }

/* ── Flash messages ──────────────────────────────────────────────── */
.flash-container { padding: 0 2rem; margin-top: 1rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--red);
  background: var(--surface);
}
.flash-info { border-color: #4a9eff; }
.flash-error { border-color: var(--red); }

/* ── Main content ────────────────────────────────────────────────── */
main { flex: 1; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--red);
}

.hero-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

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

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-deep); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }

/* ── Hero Visual ─────────────────────────────────────────────────── */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.cv-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cv-avatar-placeholder {
  width: 48px;
  height: 48px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.cv-name { font-weight: 700; font-size: 1rem; }
.cv-role { font-size: 0.75rem; color: var(--text-3); }

.cv-section { margin-bottom: 1rem; }
.cv-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.cv-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  margin-bottom: 0.35rem;
  overflow: hidden;
}
.cv-bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  animation: fillBar 2s ease forwards;
}
@keyframes fillBar {
  from { width: 0; }
}

.cv-tag-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.cv-tag {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  color: var(--text-2);
  font-family: 'DM Mono', monospace;
}

.card-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
}

/* ── Stats row ───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 3rem;
}

.stat {
  background: var(--surface);
  padding: 1.5rem 1rem;
  text-align: center;
}

.stat-num {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.2rem;
  color: var(--red);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.3rem;
  font-family: 'DM Mono', monospace;
}

/* ── How it works ────────────────────────────────────────────────── */
.section {
  padding: 5rem 4rem;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0.02em;
  margin-bottom: 3rem;
}

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

.step {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.step:hover { border-color: var(--red); transform: translateY(-2px); }

.step-num {
  font-family: 'Bebas Neue', cursive;
  font-size: 3rem;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step p { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }

/* ── Page header ─────────────────────────────────────────────────── */
.page-header {
  padding: 3rem 4rem 2rem;
  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.page-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.02em;
}

/* ── Dashboard ───────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 200px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.sidebar-section { margin-bottom: 2rem; }
.sidebar-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.quota-display {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.quota-nums {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.quota-used {
  font-family: 'Bebas Neue', cursive;
  font-size: 2rem;
  color: var(--red);
  line-height: 1;
}

.quota-total {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-3);
}

.quota-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.quota-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.quota-label { font-size: 0.7rem; color: var(--text-3); font-family: 'DM Mono', monospace; }

.plan-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  margin-bottom: 0.75rem;
}
.plan-free { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }
.plan-pro { background: var(--red-glow); color: var(--red); border: 1px solid var(--red); }
.plan-enterprise { background: #1a1000; color: #f0a000; border: 1px solid #f0a000; }

.dash-content { padding: 2.5rem 3rem; }
.dash-section-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  color: var(--text-2);
}

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

.gen-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}
.gen-item:hover { border-color: var(--red); transform: translateX(3px); }

.gen-title { font-weight: 600; font-size: 0.9rem; }
.gen-date { font-size: 0.72rem; color: var(--text-3); font-family: 'DM Mono', monospace; }
.gen-arrow { color: var(--text-3); font-size: 0.8rem; }

.empty-state {
  padding: 3rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-3);
}
.empty-state p { margin-bottom: 1rem; font-size: 0.875rem; }

/* ── Generate form ───────────────────────────────────────────────── */
.generate-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.form-panel {
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.preview-panel {
  padding: 3rem;
  background: var(--surface);
}

.form-group { margin-bottom: 1.75rem; }

label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
  resize: vertical;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--red);
}
textarea { min-height: 140px; }

.quota-warning {
  background: var(--red-glow);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 1rem;
  font-family: 'DM Mono', monospace;
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
  flex-direction: column;
  gap: 1rem;
}

.preview-empty-icon { font-size: 3rem; opacity: 0.3; }

.preview-content {
  display: none;
}
.preview-content.visible { display: block; }

.md-output {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
}
.md-output h1, .md-output h2, .md-output h3 {
  font-family: 'Bebas Neue', cursive;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.md-output h1 { font-size: 1.8rem; }
.md-output h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
.md-output h3 { font-size: 1.1rem; color: var(--red); }
.md-output ul { padding-left: 1.25rem; }
.md-output li { margin-bottom: 0.25rem; }
.md-output strong { color: var(--text); }
.md-output hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading .spinner { display: block; }
.btn.loading .btn-label { opacity: 0.7; }

.copy-btn {
  margin-top: 1.5rem;
  display: none;
}
.copy-btn.visible { display: inline-flex; }

/* ── Login page ──────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.login-logo span { color: var(--red); }

.login-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 2.5rem;
}

.oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}
.oauth-btn:hover { border-color: var(--red); transform: translateY(-1px); }

.oauth-icon { font-size: 1.1rem; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-3);
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-terms {
  margin-top: 1.5rem;
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Pricing ─────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 3rem 4rem 5rem;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.plan-card:hover { transform: translateY(-3px); }
.plan-card.featured { border-color: var(--red); }

.plan-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.plan-price {
  font-family: 'Bebas Neue', cursive;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.plan-price sup { font-size: 1.5rem; vertical-align: top; margin-top: 0.5rem; }
.plan-price-note { font-size: 0.75rem; color: var(--text-3); margin-bottom: 1.5rem; font-family: 'DM Mono', monospace; }

.plan-features {
  list-style: none;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.plan-features li {
  font-size: 0.875rem;
  color: var(--text-2);
  padding-left: 1.25rem;
  position: relative;
}
.plan-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 0.75rem;
}

.plan-cta {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

/* ── Result page ─────────────────────────────────────────────────── */
.result-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  min-height: calc(100vh - 120px);
}

.result-main {
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.result-sidebar {
  padding: 2rem;
  background: var(--surface);
}

.result-title-sm {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--text-3);
}

.footer-brand {
  font-family: 'Bebas Neue', cursive;
  letter-spacing: 0.1em;
  font-size: 1rem;
  color: var(--text-2);
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-3); text-decoration: none; }
.footer-links a:hover { color: var(--red); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 2rem; }
  .hero-visual { display: none; }
  .steps { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; padding: 2rem; }
  .generate-layout { grid-template-columns: 1fr; }
  .preview-panel { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .result-layout { grid-template-columns: 1fr; }
  .section { padding: 3rem 2rem; }
  .page-header { padding: 2rem; }
  .dash-content { padding: 2rem; }
}
