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

:root {
  --bg: #07070e;
  --surface: rgba(255,255,255,0.05);
  --surface2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --accent: #7c6fe0;
  --accent2: #00d2ff;
  --danger: #ff4757;
  --success: #2ed573;
  --text: #e8e8f0;
  --muted: #888;
  --gradient: linear-gradient(135deg, #7c6fe0, #00d2ff);
  --gradient-cv: linear-gradient(135deg, #00b4d8, #0077b6);
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7,7,14,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 8px;
  flex: 1;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-cv { color: #00b4d8 !important; }
.nav-cv:hover { background: rgba(0,180,216,0.1) !important; }
.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; padding: 6px 12px; border-radius: 8px; }
.nav-user:hover { background: var(--surface); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-accent {
  background: var(--gradient);
  color: white;
}
.btn-accent:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); }
.btn-danger {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.3);
}
.btn-danger:hover { background: rgba(255,71,87,0.25); }
.btn-xs { padding: 5px 12px; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: white;
  color: #333;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-google:hover { background: #f5f5f5; transform: translateY(-1px); }
.btn-google svg { width: 20px; height: 20px; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.page { padding: 96px 24px 60px; max-width: 1200px; margin: 0 auto; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 80px 24px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=1600&auto=format&fit=crop') center/cover no-repeat;
  opacity: 0.12;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(124,111,224,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(0,210,255,0.15) 0%, transparent 60%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}
.hero p {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== SECTIONS ===== */
.section {
  padding: 80px 24px;
}
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.section-header p { color: var(--muted); font-size: 1rem; }

/* ===== GRID & CARDS ===== */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(124,111,224,0.3); }
.card-icon { font-size: 2rem; margin-bottom: 16px; }
.card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 0.875rem; color: var(--muted); }
.card-accent { border-top: 2px solid transparent; border-image: var(--gradient); border-image-slice: 1; }

/* ===== STEPS ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; counter-reset: steps; }
.step { text-align: center; position: relative; }
.step-num {
  width: 56px; height: 56px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
  margin: 0 auto 16px;
}
.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 0.8rem; color: var(--muted); }

/* ===== CTA SECTION ===== */
.cta-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 64px 24px;
  text-align: center;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.cta-section p { color: var(--muted); margin-bottom: 28px; }

/* ===== AUTH ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  background: radial-gradient(ellipse at center, rgba(124,111,224,0.1) 0%, transparent 70%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 28px; }
.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: #0f0f1a;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
}
.auth-footer { text-align: center; font-size: 0.875rem; color: var(--muted); margin-top: 20px; }
.auth-footer a { color: var(--accent2); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input::placeholder { color: var(--muted); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.alert-error { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.3); color: #ff6b7a; }
.alert-success { background: rgba(46,213,115,0.1); border: 1px solid rgba(46,213,115,0.3); color: var(--success); }

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-admin { background: rgba(124,111,224,0.2); color: var(--accent); border: 1px solid rgba(124,111,224,0.3); }
.badge-user { background: rgba(136,136,136,0.15); color: var(--muted); border: 1px solid rgba(136,136,136,0.2); }

/* ===== AVATAR ===== */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

/* ===== DASHBOARD ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; margin-top: 32px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-value { display: block; font-size: 2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ===== ENCODE PAGE ===== */
.encode-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.encode-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.encode-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.encode-item:last-child { border-bottom: none; }
.encode-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.score-bar { margin-top: 28px; }
.score-bar-track { height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.score-bar-fill { height: 100%; background: var(--gradient); border-radius: 4px; transition: width 0.3s; }

/* ===== PROGRESS / HEATMAP ===== */
.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.heat-day {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: var(--muted);
  position: relative;
}
.heat-day.has-data { background: rgba(124,111,224,0.4); }
.heat-day.full { background: var(--accent); }

/* ===== ADMIN ===== */
.admin-page { padding: 96px 24px 60px; max-width: 1200px; margin: 0 auto; }
.admin-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.admin-search { margin-bottom: 16px; }
.admin-search input {
  width: 100%; max-width: 360px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--surface); }
.admin-actions { display: flex; gap: 6px; align-items: center; }

/* ===== CV METHOD ===== */
.cv-page { padding: 96px 24px 60px; max-width: 1000px; margin: 0 auto; }
.cv-hero {
  text-align: center;
  padding: 60px 0 40px;
}
.cv-hero h1 { font-size: 2.5rem; font-weight: 800; background: var(--gradient-cv); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.cv-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0,180,216,0.1);
  border: 1px solid rgba(0,180,216,0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #00b4d8;
  margin-bottom: 16px;
}
.cv-card {
  background: var(--surface);
  border: 1px solid rgba(0,180,216,0.15);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.cv-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; color: #00d2ff; }
.cv-card ul, .cv-card ol { margin-left: 1.5rem; }
.cv-card li { margin-bottom: 6px; font-size: 0.9rem; color: var(--muted); }
.cv-card strong { color: var(--text); }
.breadcrumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: #00b4d8; }
.breadcrumb a:hover { text-decoration: underline; }
.cv-nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 32px; }
.cv-nav-card {
  background: var(--surface);
  border: 1px solid rgba(0,180,216,0.2);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: all 0.2s;
}
.cv-nav-card:hover { transform: translateY(-4px); border-color: rgba(0,180,216,0.5); }
.cv-nav-card .cv-icon { font-size: 2rem; margin-bottom: 12px; }
.cv-nav-card h3 { font-size: 1rem; font-weight: 600; color: #00d2ff; margin-bottom: 6px; }
.cv-nav-card p { font-size: 0.8rem; color: var(--muted); }

/* ===== NOTICE CARD ===== */
.notice {
  background: rgba(0,180,216,0.06);
  border: 1px solid rgba(0,180,216,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--muted);
}
.notice a { color: #00b4d8; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
  margin-top: 80px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.footer-brand p { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 0.875rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 0.8rem; color: var(--muted); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.fade-in { animation: fadeInUp 0.5s ease forwards; }
.pulse { animation: pulse 2s ease infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .dash-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .admin-table { font-size: 0.75rem; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
}

/* ===== STREAK ===== */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,160,50,0.15);
  border: 1px solid rgba(255,160,50,0.3);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffa032;
}

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }

/* ===== ROUTINE CARDS ===== */
.routine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.2s;
}
.routine-card:hover { border-color: rgba(124,111,224,0.4); transform: translateY(-2px); }
.routine-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.routine-meta { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tag {
  padding: 3px 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}
.routine-steps { margin-top: 16px; }
.routine-step { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.875rem; }
.routine-step:last-child { border-bottom: none; }
.step-icon { font-size: 1.1rem; width: 24px; text-align: center; }

/* ===== ERROR PAGE ===== */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; }
.error-page h1 { font-size: 3rem; font-weight: 800; margin-bottom: 12px; }
.error-page p { color: var(--muted); margin-bottom: 24px; }
