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

/* ── DARK MODE (default) ── */
:root {
  --bg:     #070B14;
  --bg2:    #0D1424;
  --bg3:    #131C30;
  --mint:   #0FF4C6;
  --blue:   #5B8BF5;
  --red:    #FF4D6D;
  --amber:  #F59E0B;
  --text:   #CBD5E1;
  --muted:  #475569;
  --border: #1E2D4A;
  --grid-color: rgba(15,244,198,0.03);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* ── LIGHT MODE ── */
:root[data-theme="light"] {
  --bg:     #F0F4FF;
  --bg2:    #FFFFFF;
  --bg3:    #E8EEF8;
  --mint:   #00A884;
  --blue:   #3B6FE8;
  --red:    #E03355;
  --amber:  #D97706;
  --text:   #1E293B;
  --muted:  #64748B;
  --border: #CBD5E1;
  --grid-color: rgba(0,168,132,0.05);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Auto-follow system preference (when no manual override) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg:     #F0F4FF;
    --bg2:    #FFFFFF;
    --bg3:    #E8EEF8;
    --mint:   #00A884;
    --blue:   #3B6FE8;
    --red:    #E03355;
    --amber:  #D97706;
    --text:   #1E293B;
    --muted:  #64748B;
    --border: #CBD5E1;
    --grid-color: rgba(0,168,132,0.05);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--mint);
  transform: scale(1.1);
}


body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  transition: background-image 0.3s;
}

/* HEADER */
header {
  width: 100%;
  max-width: 960px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  gap: 16px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.shield-icon { width: 34px; height: 34px; }
.shield-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(15,244,198,0.5)); }

.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--mint);
}

.nav-links { display: flex; gap: 2px; }

.nav-link {
  padding: 7px 13px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--mint);
  background: rgba(15,244,198,0.07);
}

/* MAIN */
main {
  width: 100%;
  max-width: 640px;
  padding: 0 20px 80px;
  position: relative;
  z-index: 1;
}

/* HERO */
.hero { text-align: center; padding: 36px 0 28px; }

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--mint);
  margin-bottom: 14px;
  opacity: 0.8;
}

h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 6vw, 40px);
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}

h1 .accent {
  color: transparent;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto;
}

/* CARD */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), var(--blue), transparent);
}

/* INPUT */
.input-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mint);
  margin-bottom: 10px;
  display: block;
}

.input-wrap { position: relative; }

.scan-beam {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(15,244,198,0.12), transparent);
  pointer-events: none;
  border-radius: 12px;
}

.scan-beam.scanning { animation: beam 1.4s ease-in-out infinite; }
@keyframes beam { 0% { left: -60%; } 100% { left: 100%; } }

#user-input, .scanning-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scanning-input { border-color: var(--mint); color: var(--mint); }

#user-input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(15,244,198,0.1);
}

#user-input::placeholder { color: var(--muted); }

.error-msg {
  color: var(--red);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 8px;
  display: none;
}

/* BUTTON */
#go-btn {
  width: 100%;
  margin-top: 16px;
  padding: 15px;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  border: none;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

#go-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15,244,198,0.2); }
#go-btn:active { transform: translateY(0); }
#go-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* CHIPS */
.trust-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; justify-content: center; }

.chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* TERMINAL */
.terminal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  min-height: 120px;
  transition: background 0.3s, border-color 0.3s;
}

.t-line { display: flex; gap: 8px; margin-bottom: 8px; opacity: 0; animation: fadeIn 0.3s forwards; }
.t-line:nth-child(1) { animation-delay: 0.2s; }
.t-line:nth-child(2) { animation-delay: 0.9s; }
.t-line:nth-child(3) { animation-delay: 1.7s; }
.t-line:nth-child(4) { animation-delay: 2.5s; }
@keyframes fadeIn { to { opacity: 1; } }

.t-prompt { color: var(--mint); }
.t-text   { color: #64748B; }

.cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--mint);
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

/* RESULT */
.result-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }

.score-badge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.score-ring  { width: 80px; height: 80px; position: relative; }
.score-ring svg { transform: rotate(-90deg); }

.score-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800; font-size: 17px; color: #fff;
}

.score-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.12em; }

.target-info { flex: 1; }

.target-email {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--mint);
  word-break: break-all; margin-bottom: 8px;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.status-pill.safe   { background: rgba(15,244,198,0.1); color: var(--mint);  border: 1px solid rgba(15,244,198,0.25); }
.status-pill.medium { background: rgba(245,158,11,0.1); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.status-pill.risky  { background: rgba(255,77,109,0.1); color: var(--red);   border: 1px solid rgba(255,77,109,0.25); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.analysis-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.analysis-box h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em; color: var(--mint); margin-bottom: 12px;
}

#ai-output { white-space: pre-wrap; font-size: 14px; line-height: 1.75; }

.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.tip-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.tip-icon  { font-size: 20px; margin-bottom: 6px; }
.tip-title { font-size: 12px; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.tip-desc  { font-size: 11px; color: var(--muted); line-height: 1.5; }

#reset-btn {
  width: 100%; padding: 13px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}

#reset-btn:hover { border-color: var(--mint); color: var(--mint); }

/* FEATURES */
.features { margin-top: 48px; }
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--mint); margin-bottom: 20px; opacity: 0.8;
}

.features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: rgba(15,244,198,0.3); }
.feature-icon  { font-size: 22px; margin-bottom: 10px; }
.feature-title { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 6px; }
.feature-desc  { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* FOOTER */
footer {
  width: 100%;
  max-width: 960px;
  border-top: 1px solid var(--border);
  padding: 28px;
  position: relative;
  z-index: 1;
}

.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em;
}

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 12px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--mint); }
.footer-copy { font-size: 11px; color: #1E2D4A; font-family: 'JetBrains Mono', monospace; width: 100%; }

/* INNER PAGES */
.page-main { width: 100%; max-width: 700px; padding: 0 20px 80px; position: relative; z-index: 1; }

.page-hero { text-align: center; padding: 40px 0 32px; }
.page-hero h1 { font-size: clamp(24px, 5vw, 34px); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--muted); text-decoration: none; margin-bottom: 24px; transition: color 0.2s;
}
.back-link:hover { color: var(--mint); }

.content-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px;
  position: relative; overflow: hidden; margin-bottom: 16px;
}

.content-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), var(--blue), transparent);
}

.content-card h2 {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 12px; margin-top: 32px;
}
.content-card h2:first-child { margin-top: 0; }

.content-card p { font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 14px; }

.content-card ul { list-style: none; margin-bottom: 14px; }
.content-card ul li {
  font-size: 14px; color: var(--text); line-height: 1.8;
  padding-left: 20px; position: relative; margin-bottom: 8px;
}
.content-card ul li::before { content: '▸'; position: absolute; left: 0; color: var(--mint); }

.step-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.step-num {
  width: 36px; height: 36px;
  background: rgba(15,244,198,0.1);
  border: 1px solid rgba(15,244,198,0.3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 13px;
  color: var(--mint); flex-shrink: 0;
}
.step-body h4 { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.step-body p  { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

/* BLOG */
.blog-grid { display: flex; flex-direction: column; gap: 14px; }

.blog-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  text-decoration: none; transition: border-color 0.2s, transform 0.15s; display: block;
}
.blog-card:hover { border-color: rgba(15,244,198,0.35); transform: translateY(-2px); }

.blog-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--mint); margin-bottom: 8px;
}
.blog-title { font-size: 16px; font-weight: 700; color: #e2e8f0; margin-bottom: 6px; }
.blog-desc  { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* CONTACT FORM */
.form-group { margin-bottom: 20px; }
.form-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--mint); display: block; margin-bottom: 8px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px; color: #fff;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(15,244,198,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg3); }

.submit-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  border: none; border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800; font-size: 13px; letter-spacing: 0.1em;
  color: var(--bg); cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 8px;
}
.submit-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15,244,198,0.2); }

.success-msg {
  background: rgba(15,244,198,0.08);
  border: 1px solid rgba(15,244,198,0.25);
  border-radius: 10px; padding: 16px 20px;
  font-size: 14px; color: var(--mint); text-align: center;
  display: none; margin-top: 16px;
}

.contact-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.contact-info-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; text-align: center;
}
.contact-info-icon { font-size: 22px; margin-bottom: 8px; }
.contact-info-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 4px; }
.contact-info-val { font-size: 13px; color: #e2e8f0; font-weight: 600; }

/* COOKIES */
.cookie-section { margin-bottom: 28px; }
.cookie-type {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  flex-wrap: wrap; gap: 10px;
}
.cookie-name { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: #e2e8f0; }
.cookie-desc-small { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cookie-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; letter-spacing: 0.08em;
}
.badge-required { background: rgba(15,244,198,0.1); color: var(--mint); border: 1px solid rgba(15,244,198,0.25); }
.badge-none     { background: rgba(71,85,105,0.2);   color: var(--muted); border: 1px solid var(--border); }

/* RESPONSIVE */
@media (max-width: 640px) {
  header { padding: 16px; flex-wrap: wrap; }
  .nav-links { display: none; }
  main, .page-main { padding: 0 14px 60px; }
  .card, .content-card { padding: 22px 18px; }
  .tips-grid, .features-grid, .contact-info-grid { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── LIGHT MODE OVERRIDES ── */
/* Elements with hardcoded dark colors need explicit light overrides */
:root[data-theme="light"] .content-card h2,
:root[data-theme="light"] .feature-title,
:root[data-theme="light"] .tip-title,
:root[data-theme="light"] .blog-title,
:root[data-theme="light"] .step-body h4,
:root[data-theme="light"] .score-val,
:root[data-theme="light"] .contact-info-val {
  color: var(--text);
}

:root[data-theme="light"] .blog-card,
:root[data-theme="light"] .feature-card,
:root[data-theme="light"] .tip-card,
:root[data-theme="light"] .analysis-box,
:root[data-theme="light"] .contact-info-card,
:root[data-theme="light"] .cookie-type,
:root[data-theme="light"] .content-card {
  background: var(--bg2);
  border-color: var(--border);
  transition: background 0.3s, border-color 0.3s;
}

:root[data-theme="light"] .scanning-input {
  background: var(--bg3);
  color: var(--mint);
}

:root[data-theme="light"] #user-input,
:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-textarea,
:root[data-theme="light"] .form-select {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="light"] .score-ring circle:first-child {
  stroke: var(--border);
}

/* Auto system light mode same overrides */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .content-card h2,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .feature-title,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .tip-title,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .blog-title,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .step-body h4,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .score-val,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .contact-info-val { color: var(--text); }

  :root:not([data-theme="dark"]):not([data-theme="light"]) .blog-card,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .feature-card,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .tip-card,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .analysis-box,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .content-card { background: var(--bg2); border-color: var(--border); }

  :root:not([data-theme="dark"]):not([data-theme="light"]) #user-input,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .form-input,
  :root:not([data-theme="dark"]):not([data-theme="light"]) .form-textarea { background: var(--bg3); border-color: var(--border); color: var(--text); }
}

/* ── GLOBAL TRANSITION ── */
header, footer, .card, .content-card, .feature-card,
.tip-card, .analysis-box, .blog-card, .contact-info-card,
.cookie-type, nav, .chip, .lang-btn, .nav-link,
.footer-links a, .back-link, .score-label, .target-email,
.blog-tag, .feature-desc, .blog-desc, .tip-desc {
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
