/* ==========================================================================
   InterviewPrep Platform — Design System & Main Stylesheet
   Inspired by zasqlpython.ru, Supabase, and Linear dark design patterns
   ========================================================================== */

:root {
  --bg-dark: #0A0D14;
  --bg-surface: #121622;
  --bg-surface-elevated: #181E2E;
  --bg-card: #141926;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  
  --primary: #FF5A1F;
  --primary-hover: #E04810;
  --primary-glow: rgba(255, 90, 31, 0.25);
  
  --accent-cyan: #22D3EE;
  --accent-cyan-bg: rgba(34, 211, 238, 0.12);
  --accent-purple: #A78BFA;
  --accent-purple-bg: rgba(167, 139, 250, 0.12);
  --accent-green: #10B981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-red: #EF4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-yellow: #F59E0B;
  --accent-yellow-bg: rgba(245, 158, 11, 0.12);

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-subtle: #6B7280;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-dark: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-hover: #CBD5E1;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #94A3B8;
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Navigation & Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #FF8542);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.brand-badge {
  font-size: 0.72rem;
  background: rgba(255, 90, 31, 0.15);
  color: var(--primary);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-yellow-bg);
  color: var(--accent-yellow);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

/* ==========================================================================
   Page Layout & Common Elements
   ========================================================================== */
.main-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-view {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner {
  text-align: center;
  padding: 3.5rem 1rem 3rem;
  max-width: 860px;
  margin: 0 auto 3rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}

.gradient-text {
  background: linear-gradient(135deg, #FF5A1F 0%, #FFA26B 50%, #22D3EE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-color);
}

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

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.icon-sql { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.icon-py { background: rgba(255, 90, 31, 0.12); color: var(--primary); }
.icon-ai { background: var(--accent-purple-bg); color: var(--accent-purple); }
.icon-theory { background: var(--accent-green-bg); color: var(--accent-green); }

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 1.25rem;
}

.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

/* ==========================================================================
   Flashcards Module
   ========================================================================== */
.flashcards-container {
  max-width: 640px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover, .pill.active {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

.flashcard-stage {
  perspective: 1000px;
  height: 380px;
  margin-bottom: 1.75rem;
}

.flashcard-box {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: var(--radius-xl);
}

.flashcard-box.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: var(--bg-surface-elevated);
}

.card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.card-tag.junior { background: var(--accent-green-bg); color: var(--accent-green); }
.card-tag.middle { background: var(--accent-yellow-bg); color: var(--accent-yellow); }
.card-tag.senior { background: var(--accent-red-bg); color: var(--accent-red); }

.card-content {
  margin: auto 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
}

.card-answer-text {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-main);
  white-space: pre-line;
  line-height: 1.6;
}

.card-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-align: center;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.btn-swipe {
  flex: 1;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-swipe-repeat {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-swipe-repeat:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-swipe-know {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-swipe-know:hover {
  background: rgba(16, 185, 129, 0.22);
}

/* ==========================================================================
   Quiz Module
   ========================================================================== */
.quiz-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.quiz-question {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  line-height: 1.45;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.quiz-option {
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--bg-surface-elevated);
}

.quiz-option.correct {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
  color: #fff;
}

.quiz-option.wrong {
  background: var(--accent-red-bg);
  border-color: var(--accent-red);
  color: #fff;
}

.quiz-feedback {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   SQL & Python Interactive Sandboxes
   ========================================================================== */
.sandbox-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-height: 600px;
}

@media (max-width: 900px) {
  .sandbox-layout {
    grid-template-columns: 1fr;
  }
}

.task-description-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-height: 750px;
}

.task-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.schema-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.schema-table-title {
  color: var(--accent-cyan);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.code-editor-wrap {
  background: #0D1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.editor-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-title {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.code-textarea {
  width: 100%;
  height: 250px;
  background: transparent;
  color: #E6EDF3;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 1rem;
  border: none;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Results & Tables */
.results-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

.data-table th, .data-table td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  font-weight: 600;
}

.data-table tr:hover {
  background: var(--bg-surface);
}

.result-status-banner {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-success {
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green);
  color: #fff;
}

.status-error {
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red);
  color: #fff;
}

/* ==========================================================================
   AI Hub & Chat Simulator
   ========================================================================== */
.ai-hub-container {
  max-width: 820px;
  margin: 0 auto;
}

.chat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  height: 580px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg {
  max-width: 80%;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.5;
}

.msg-ai {
  align-self: flex-start;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.msg-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-input-bar {
  padding: 1rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
}

.chat-input:focus {
  border-color: var(--primary);
}

/* Scorecard Modal */
.scorecard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.verdict-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.verdict-hire {
  background: var(--accent-green-bg);
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
}

.verdict-nohire {
  background: var(--accent-red-bg);
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
}

.score-bars {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.score-bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.score-bar-label {
  width: 140px;
  font-size: 0.88rem;
  font-weight: 600;
}

.score-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 999px;
}

/* ==========================================================================
   Roadmap Tree
   ========================================================================== */
.roadmap-container {
  max-width: 800px;
  margin: 0 auto;
}

.roadmap-step {
  position: relative;
  padding-left: 3rem;
  padding-bottom: 2.5rem;
  border-left: 2px solid var(--border-color);
}

.roadmap-step:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.roadmap-node-circle {
  position: absolute;
  left: -17px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
}

.roadmap-card:hover {
  border-color: var(--border-hover);
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 13, 20, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem;
  justify-content: space-around;
  z-index: 1000;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-nav { display: flex; }
  body { padding-bottom: 60px; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Auth Modal & User Header Widget
   ========================================================================== */
/* ==========================================================================
   Pixel-Perfect Auth Card & Art (Matches Reference UX Design)
   ========================================================================== */
/* ==========================================================================
   Exact Pixel-Perfect Auth Page & Card (Matches Reference Image)
   ========================================================================== */
.auth-fullpage-view {
  min-height: 100vh;
  width: 100%;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #f8fafc !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.auth-fullpage-view.active {
  display: flex !important;
}

/* 1. Top-Left Solid Blue Polygon Block (Exact match from screenshot: 192px x 156px) */
.auth-ref-art-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 192px;
  height: 156px;
  background: #3b82f6;
  pointer-events: none;
  z-index: 0;
}

/* 2. Bottom-Right Diagonal Hatched Pattern (Exact match from screenshot: 240px x 240px) */
.auth-ref-art-bottom {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 240px;
  height: 240px;
  background: repeating-linear-gradient(
    45deg,
    #60a5fa 0,
    #60a5fa 1.5px,
    transparent 1.5px,
    transparent 9px
  );
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

/* 3. The Central Pristine White Card */
.auth-ref-card-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 368px;
  margin: auto;
}

.auth-ref-card {
  background: #ffffff !important;
  border-radius: 24px;
  width: 100%;
  padding: 34px 28px 30px 28px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-sizing: border-box;
}

/* Card Heading: Sign up */
.auth-ref-title {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin: 0 0 22px 0;
  font-family: inherit;
  letter-spacing: -0.01em;
}

/* Alert Notification (Error message) */
.auth-ref-alert {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #dc2626;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  text-align: center;
}

/* Form Fields */
.auth-ref-field {
  margin-bottom: 13px;
  position: relative;
}

/* Outlined Box with Notched Label for Name (Exact style from screenshot) */
.auth-ref-box-notched {
  position: relative;
  border: 1.5px solid #0091ff;
  border-radius: 6px;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #ffffff;
  box-sizing: border-box;
}

.auth-ref-notch-label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: #ffffff;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: #0091ff;
  line-height: 1;
}

/* Standard Outlined Box for Email & Password */
.auth-ref-box {
  position: relative;
  border: 1.2px solid #cbd5e1;
  border-radius: 6px;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.auth-ref-box:focus-within {
  border-color: #0091ff;
  box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.12);
}

.auth-ref-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14.5px;
  color: #111827;
  background: transparent;
  padding: 0;
  font-family: inherit;
}

.auth-ref-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Eye Toggle Button */
.auth-ref-eye-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  transition: color 0.15s ease;
}

.auth-ref-eye-btn:hover {
  color: #111827;
}

/* Primary Submit Button: Sign Up / Log In */
.auth-ref-submit-btn {
  width: 100%;
  height: 44px;
  background: #0091ff;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
  font-family: inherit;
}

.auth-ref-submit-btn:hover {
  background: #0080e5;
}

.auth-ref-submit-btn:active {
  transform: scale(0.99);
}

.auth-ref-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* "Already have an account? Log In" */
.auth-ref-switch {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #64748b;
}

.auth-ref-switch-link {
  color: #0091ff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font-size: inherit;
  font-family: inherit;
}

.auth-ref-switch-link:hover {
  text-decoration: underline;
}

/* Divider —— or —— */
.auth-ref-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: #94a3af;
  font-size: 12px;
}

.auth-ref-divider::before,
.auth-ref-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-ref-divider span {
  padding: 0 10px;
}

/* Google Button (White background with solid dark border) */
.auth-ref-google-btn {
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid #1e293b;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.auth-ref-google-btn:hover {
  background: #f8fafc;
}

/* Subtle Telegram link underneath */
.auth-ref-sub-action {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
}

.auth-ref-sub-link {
  color: #0088cc;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.auth-ref-sub-link:hover {
  text-decoration: underline;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   Guest vs Authenticated State Rules
   ========================================================================== */
body.is-guest .auth-only {
  display: none !important;
}

body.is-authenticated .guest-only {
  display: none !important;
}

/* ==========================================================================
   Minimalistic Landing Page (Guest)
   ========================================================================== */
.landing-hero-wrap {
  text-align: center;
  max-width: 840px;
  margin: 2.5rem auto 4rem auto;
}

.landing-headline {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.landing-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 2.25rem auto;
}

.landing-cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.landing-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.landing-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.12);
}

.landing-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.landing-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.landing-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   OTP Input & Telegram Auth
   ========================================================================== */
.otp-display-code {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 2px dashed var(--primary);
  background: var(--bg-surface);
  color: var(--accent-cyan);
  margin: 1.25rem 0;
}

.btn-telegram {
  background: #24A1DE;
  color: #fff;
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-telegram:hover {
  background: #1e87bb;
  transform: translateY(-1px);
}

/* ==========================================================================
   Admin Portal & Management
   ========================================================================== */
.admin-badge-btn {
  background: rgba(245, 158, 11, 0.15) !important;
  color: var(--accent-yellow) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  font-weight: 700 !important;
}

.admin-badge-btn:hover {
  background: rgba(245, 158, 11, 0.25) !important;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.admin-stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.25rem;
}

.admin-tabs {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}

.admin-tab-btn.active {
  color: var(--accent-yellow);
  border-bottom-color: var(--accent-yellow);
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table tr:hover {
  background: var(--bg-surface-elevated);
}

