/* ═══════════════════════════════════════════════════════════════
   style.css — PlagiCheck AI Premium Design System
   Dark glassmorphism + neon-purple accent theme
═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts + CSS Variables ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #0f0f20;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.4);

  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(139, 92, 246, 0.25);

  --text-primary: #f8f8fa;
  --text-secondary: #b0b0cc;
  --text-muted: #80809c;

  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, sans-serif;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(99, 102, 241, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(167, 139, 250, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body>* {
  position: relative;
  z-index: 1;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-ai {
  background: linear-gradient(135deg, var(--accent-light), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.api-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }

  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  padding-top: 60px;
  padding-bottom: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-light);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  animation: fade-in 0.6s ease both;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 12px;
  animation: fade-up 0.6s ease 0.1s both;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 12px auto 0;
  animation: fade-up 0.6s ease 0.2s both;
}

.stats-row {
  animation: fade-up 0.6s ease 0.3s both;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.stat-chip:hover {
  border-color: var(--border-glow);
  color: var(--accent-light);
  background: rgba(139, 92, 246, 0.08);
}

/* ─── Mode Bar ───────────────────────────────────────────────── */
.mode-bar {
  animation: fade-up 0.5s ease 0.35s both;
}

.mode-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.mode-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ─── Editor Panels ──────────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 420px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  animation: fade-up 0.5s ease 0.4s both;
}

.panel:hover,
.panel:focus-within {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.panel-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--border-glow);
  color: var(--accent-light);
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.panel-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
}

.panel-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.75;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.panel-textarea::placeholder {
  color: var(--text-muted);
}

.panel-textarea::-webkit-scrollbar {
  width: 4px;
}

.panel-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.panel-textarea::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.word-count,
.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.uniqueness-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  animation: fade-in 0.4s ease;
}

/* ─── Output States ──────────────────────────────────────────── */
.output-placeholder,
.output-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 16px;
  color: var(--text-muted);
}

.placeholder-icon {
  width: 60px;
  height: 60px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: rgba(139, 92, 246, 0.4);
}

.placeholder-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Triple ring loader */
.ai-loader {
  position: relative;
  width: 64px;
  height: 64px;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: spin 1.4s linear infinite;
}

.loader-ring:nth-child(1) {
  border-top-color: var(--accent);
  animation-duration: 1.0s;
}

.loader-ring:nth-child(2) {
  border-right-color: var(--accent-light);
  inset: 8px;
  animation-duration: 1.3s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  border-bottom-color: #c4b5fd;
  inset: 16px;
  animation-duration: 1.7s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ─── Rewrite Button ─────────────────────────────────────────── */
.btn-rewrite {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  padding: 16px 40px;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.4);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-rewrite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn-rewrite:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-rewrite:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.55);
}

.btn-rewrite:active:not(:disabled) {
  transform: translateY(0);
}

.btn-rewrite:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  font-size: 1.1rem;
}

/* ─── Features Section ───────────────────────────────────────── */
.features-section {
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: var(--transition);
  height: 100%;
}

.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-light);
  margin: 0 auto 16px;
}

.feature-card h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  background: rgba(30, 26, 50, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary);
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast-body {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─── Keyframe Animations ────────────────────────────────────── */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .panel {
    height: 320px;
  }

  .btn-rewrite {
    padding: 14px 32px;
    font-size: 0.95rem;
  }

  .hero {
    padding-top: 40px;
  }
}

@media (max-width: 480px) {
  .mode-tabs {
    width: 100%;
  }

  .mode-tab {
    flex: 1;
    text-align: center;
  }
}

/* ─── Score Panel ────────────────────────────────────────────── */
.score-panel {
  margin: 32px auto 0;
  max-width: 860px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  animation: fade-up 0.5s ease both;
  overflow: hidden;
}

.score-panel-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 28px 36px;
  flex-wrap: wrap;
}

/* Gauge */
.gauge-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.gauge-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.4s ease;
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-sub {
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gauge-caption {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  max-width: 130px;
  line-height: 1.4;
}

.gauge-caption.risk-low {
  color: var(--success);
}

.gauge-caption.risk-medium {
  color: var(--warning);
}

.gauge-caption.risk-high {
  color: var(--error);
}

/* Metric Bars */
.metric-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 220px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  overflow: hidden;
}

.metric-bar {
  height: 100%;
  border-radius: 30px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.uniqueness-bar {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.cosine-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.levenshtein-bar {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
}

.metric-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}


/* Verdict Banner */
.verdict-banner {
  width: 100%;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

/* ═══════════════════════════════════════════════════════════════
   UI ENHANCEMENTS
═══════════════════════════════════════════════════════════════ */

/* ─── Rewrite Progress Bar ───────────────────────────────────── */
.rewrite-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--accent) 30%,
      var(--accent-light) 60%,
      transparent 100%);
  background-size: 200% 100%;
  animation: progress-sweep 1.4s ease-in-out infinite;
}

@keyframes progress-sweep {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Panel border pulses purple during rewrite */
.panel-loading {
  border-color: var(--border-glow) !important;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25),
    0 0 28px rgba(139, 92, 246, 0.12) !important;
  animation: panel-pulse 2s ease-in-out infinite;
}

@keyframes panel-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 0 28px rgba(139, 92, 246, 0.12);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139, 92, 246, 0.2);
  }
}

/* ─── Copy Button Success State ──────────────────────────────── */
.copy-success {
  color: var(--success) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
  background: rgba(34, 197, 94, 0.12) !important;
  transition: all 0.2s ease;
}

/* ─── Counter Warning / Danger ───────────────────────────────── */
.counter-warn {
  color: var(--warning) !important;
  font-weight: 600;
}

.counter-danger {
  color: var(--error) !important;
  font-weight: 700;
  animation: blink-warn 1s ease-in-out 3;
}

@keyframes blink-warn {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ─── Mobile Responsive Improvements ────────────────────────── */

/* Tablets (≤ 991px) */
@media (max-width: 991px) {
  .panel {
    height: 280px;
  }

  .score-panel-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 24px;
  }

  .gauge-block {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    width: 100%;
  }

  .gauge-ring {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
  }

  .gauge-caption {
    text-align: left;
    max-width: none;
  }

  .metric-bars {
    width: 100%;
  }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  .hero {
    padding-top: 36px;
    padding-bottom: 24px;
  }

  .hero-title {
    letter-spacing: -0.8px;
  }

  .panel {
    height: 240px;
  }

  .btn-rewrite {
    padding: 14px 28px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }

  /* Counters side by side below textarea */
  .panel-footer {
    flex-wrap: wrap;
    gap: 6px;
  }

  .word-count,
  .char-count {
    font-size: 0.72rem;
  }

  /* Mode tabs: full-width scrollable row */
  .mode-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .mode-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .mode-tab {
    white-space: nowrap;
    padding: 6px 14px;
  }

  /* Score panel */
  .score-panel {
    margin: 20px 0 0;
  }

  .score-panel-inner {
    padding: 16px;
    gap: 16px;
  }

  .metric-label {
    width: 70px;
    font-size: 0.6rem;
  }

  .metric-val {
    width: 32px;
    font-size: 0.6rem;
  }
}

/* Small phones (≤ 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 0.9rem;
  }

  .stats-row {
    gap: 8px;
  }

  .stat-chip {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .panel {
    height: 200px;
  }

  .panel-textarea {
    font-size: 0.85rem;
    padding: 12px;
  }

  .navbar {
    padding: 12px 16px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .gauge-ring {
    width: 72px;
    height: 72px;
  }

  .gauge-pct {
    font-size: 0.8rem;
  }

  /* Stack mode tabs in a 2×2 grid */
  .mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-tab {
    text-align: center;
  }

  /* Section titles */
  .section-title {
    font-size: 1.4rem;
  }

  .feature-card {
    padding: 20px 16px;
  }

  .feature-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}

/* ─── Disclaimer Section ─────────────────────────────────────── */
.disclaimer-section {
  background: transparent;
}

.disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  max-width: 860px;
  margin: 0 auto;
}

.disclaimer-icon {
  font-size: 1.3rem;
  color: var(--warning);
  margin-top: 2px;
  flex-shrink: 0;
}

.disclaimer-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.disclaimer-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.disclaimer-text strong {
  color: #fbbf24;
  font-weight: 600;
}

/* ─── AI Detection Panel — Competitive Dual-Gauge Design ────── */
.ai-detect-panel {
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.ai-detect-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.08);
  border-bottom: 1px solid var(--border-color);
}

.ai-detect-badge {
  margin-left: auto;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-light);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

/* Body: gauge | center | gauge */
.ai-detect-body {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: start;
  gap: 0;
  padding: 28px 24px;
}

/* ── Gauge blocks (left & right) ── */
.ai-gauge-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ai-gauge-ring {
  position: relative;
  width: 130px;
  height: 130px;
}

.ai-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ai-gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

.ai-gauge-arc {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.human-arc {
  stroke: #22c55e;
}

.ai-arc {
  stroke: #ef4444;
}

.ai-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ai-gauge-pct {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.ai-gauge-sub {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 3px;
}

.ai-gauge-caption {
  font-size: 0.73rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
}

.human-caption {
  color: #22c55e;
}

.ai-caption {
  color: #ef4444;
}

/* ── Center verdict + breakdown ── */
.ai-center-verdict {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-verdict-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-align: center;
}

.ai-verdict-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.ai-verdict-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-comparison-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ai-compare-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.before-chip {
  background: rgba(239, 68, 68, 0.12);
}

.after-chip {
  background: rgba(34, 197, 94, 0.12);
}

/* ── Breakdown signal bars ── */
.ai-breakdown {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ai-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-bk-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
}

.ai-bk-bar-wrap {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  height: 7px;
  overflow: hidden;
}

.ai-bk-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-bk-val {
  font-size: 0.7rem;
  font-weight: 700;
  width: 36px;
  text-align: right;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── Footer button ── */
.ai-detect-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.btn-detect {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-detect:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent);
  color: #fff;
}

.btn-detect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-detect-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ai-detect-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ai-gauge-block {
    flex-direction: row;
    gap: 20px;
  }

  .ai-gauge-ring {
    width: 90px;
    height: 90px;
  }

  .ai-gauge-pct {
    font-size: 1.1rem;
  }
}

/* ─── Section Subtitle ───────────────────────────────────────── */
.section-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── How It Works ───────────────────────────────────────────── */
.howit-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  height: 100%;
  padding: 32px 28px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.step-number {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 99px;
}

.step-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent-light);
  margin: 16px auto 16px;
}

.step-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ─── Writing Modes Cards ────────────────────────────────────── */
.modes-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.mode-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  height: 100%;
  transition: var(--transition);
}

.mode-info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.mode-info-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.standard-card {
  border-top: 3px solid #8b5cf6;
}

.academic-card {
  border-top: 3px solid #3b82f6;
}

.creative-card {
  border-top: 3px solid #ec4899;
}

.simplified-card {
  border-top: 3px solid #22c55e;
}

.standard-card .mode-info-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
}

.academic-card .mode-info-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.creative-card .mode-info-icon {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
}

.simplified-card .mode-info-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.mode-info-card h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.mode-info-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

.mode-info-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* ─── FAQ Accordion ──────────────────────────────────────────── */
.faq-section {
  border-bottom: 1px solid var(--border-color);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s;
}

.faq-item:has(.faq-question[aria-expanded="true"]) {
  border-color: rgba(139, 92, 246, 0.35);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--accent-light);
}

.faq-icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--accent);
  transition: transform 0.3s;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 0 20px;
}

.faq-question[aria-expanded="true"]+.faq-answer {
  padding-bottom: 16px;
}

/* ─── Footer Multi-Column ────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-light);
}

.footer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.footer-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
}