/* ===================================================================
   AssureMind Issues — styles
   Theme mirrors AssureMind Studio: indigo→violet accent, emerald/rose
   status colors, white cards on a light-gray app surface. Supports
   light (default) and dark mode via [data-theme] on <html>.
   Mobile-first.
   =================================================================== */

/* ---------- LIGHT THEME (default) ---------- */
:root {
  /* surfaces */
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --input-bg: #f8fafc;
  --border: #e3e8ef;
  --border-soft: #eef2f7;
  --header-bg: rgba(255, 255, 255, 0.82);

  /* text */
  --text: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* accents — indigo / violet */
  --indigo: #6366f1;
  --indigo-bright: #7c3aed;
  --indigo-soft: #eef2ff;

  /* status */
  --teal: #10b981;        /* success / secondary */
  --teal-bright: #059669;
  --teal-ink: #ffffff;
  --danger: #ef4444;
  --warn: #f59e0b;

  --gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);

  /* shape */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --shadow: 0 4px 22px rgba(15, 23, 42, 0.07);
  --shadow-glow: 0 8px 30px rgba(124, 58, 237, 0.22);

  --maxw: 980px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ---------- DARK THEME ---------- */
:root[data-theme="dark"] {
  --bg: #0b0e16;
  --surface: #141a25;
  --surface-2: #1a2130;
  --surface-3: #222b3b;
  --input-bg: #0e131d;
  --border: #29313f;
  --border-soft: #1e2530;
  --header-bg: rgba(11, 14, 22, 0.82);

  --text: #e6edf3;
  --text-muted: #9aa6b6;
  --text-dim: #6b7787;

  --indigo: #818cf8;
  --indigo-bright: #a78bfa;
  --indigo-soft: rgba(124, 58, 237, 0.16);

  --teal: #34d399;
  --teal-bright: #10b981;
  --teal-ink: #04140a;
  --danger: #f87171;
  --warn: #fbbf24;

  --gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);

  --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.3);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--indigo-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.7em 1.3em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--indigo-bright); outline-offset: 2px; }

.btn-primary { background: var(--indigo); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--indigo-bright); }

.btn-secondary { background: var(--teal); color: var(--teal-ink); }
.btn-secondary:hover { background: var(--teal-bright); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--text-dim); }

.btn-lg { font-size: 1.05rem; padding: 0.85em 1.6em; }
.btn-sm { font-size: 0.82rem; padding: 0.45em 0.85em; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3em;
}
.btn-close:hover { color: var(--text); }

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

/* ---------- theme toggle ---------- */
.theme-toggle { padding: 0.45em 0.6em; font-size: 0.95rem; line-height: 1; }
.theme-icon-light { display: none; }
.theme-icon-dark { display: inline; }
:root[data-theme="dark"] .theme-icon-light { display: inline; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  display: block;
}
.brand-mark { font-size: 1.3rem; }
.brand-word {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav { display: none; gap: 4px; margin-left: auto; }
.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4em 0.7em;
  border-radius: var(--radius-sm);
}
.nav-link:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-nav + .header-actions { margin-left: 8px; }

.token-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.token-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
.token-status.active .dot { background: var(--teal); animation: pulseDot 2s infinite; }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- token banner ---------- */
.token-banner {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), rgba(124, 58, 237, 0.1));
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.token-banner[hidden] { display: none; }
.token-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.token-banner-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- hero (always rich/dark for the neural-net signature) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 70px 0 60px;
  background: linear-gradient(160deg, #0e1330 0%, #171c44 55%, #0b0e1c 100%);
  border-bottom: 1px solid var(--border);
}
.hero-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}
.hero-glow {
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.35), transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 500;
  color: #c4b5fd;
  margin: 0 0 16px;
  padding: 0.4em 0.95em;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 999px;
}
.hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.9);
}
.hero-title {
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  font-size: clamp(1.05rem, 3.5vw, 1.4rem);
  font-weight: 600;
  color: #eef1f8;
  margin: 12px 0 0;
}
.hero-lead {
  max-width: 620px;
  margin: 18px auto 0;
  color: rgba(230, 237, 243, 0.72);
  font-size: 1.02rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 34px 0 0;
}
.hero-cta .btn-ghost { color: #eef1f8; border-color: rgba(255, 255, 255, 0.25); }
.hero-cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 30px 0 0;
}
.pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.4em 0.9em;
  color: rgba(230, 237, 243, 0.82);
}
a.pill:hover { border-color: #a78bfa; color: #fff; text-decoration: none; }
.pill-muted { color: rgba(230, 237, 243, 0.55); }

/* ---------- main / sections ---------- */
.main-content { padding: 60px 20px 40px; display: flex; flex-direction: column; gap: 40px; }

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}

.section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.section-icon {
  font-size: 1.4rem;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.section-icon.bug { background: rgba(239, 68, 68, 0.12); }
.section-icon.feature { background: rgba(16, 185, 129, 0.12); }
.section-icon.question { background: rgba(124, 58, 237, 0.14); }
.section-head h2 { margin: 0; font-size: 1.5rem; color: var(--text); }
.section-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 0.93rem; }

/* ---------- forms ---------- */
.issue-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; }

label {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.req { color: var(--danger); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7em 0.85em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 60px; }
textarea.mono { font-family: var(--mono); font-size: 0.85rem; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  padding-right: 2.2em;
  cursor: pointer;
}

input.invalid, textarea.invalid { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: 0.8rem; min-height: 0; }
.error-msg:empty { display: none; }

.form-footer { margin-top: 6px; }
.powered {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 12px 0 0;
}

/* result cards */
.form-result { margin-top: 4px; }
.result-card {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeUp 0.35s ease;
}
.result-card.success { background: rgba(16, 185, 129, 0.12); border: 1px solid var(--teal); }
.result-card.error { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); }
.result-card .result-title { font-weight: 700; }
.result-card a { font-weight: 600; }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.85;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  padding-top: 48px;
  padding-bottom: 32px;
}

.footer-logo { display: inline-flex; align-items: center; gap: 0.55em; }
.footer-logo:hover { text-decoration: none; }
.footer-logo img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.footer-logo .brand-word { font-size: 1.35rem; font-weight: 800; }
.footer-desc {
  margin: 14px 0 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 340px;
  line-height: 1.7;
}

.footer-social { display: flex; gap: 10px; }
.social-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.social-btn:hover {
  color: #fff;
  background: var(--indigo);
  border-color: var(--indigo);
  transform: translateY(-2px);
  text-decoration: none;
}

.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h3 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}
.footer-col a { color: var(--text-muted); font-size: 0.9rem; width: fit-content; }
.footer-col a:hover { color: var(--indigo-bright); text-decoration: none; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  padding-bottom: 30px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.footer-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-pow { font-family: var(--mono); }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--text); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
}
.modal-close { position: absolute; top: 12px; right: 14px; }
.modal h2 { margin: 0 0 10px; font-size: 1.3rem; }
.modal-lead { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 18px; }

.token-input-wrap { display: flex; gap: 6px; }
.token-input-wrap input { flex: 1; font-family: var(--mono); font-size: 0.85rem; }
.token-toggle { flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); cursor: pointer; color: var(--text-muted); }
.token-toggle:hover { color: var(--text); }

.token-help { margin: 18px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.token-help summary { cursor: pointer; color: var(--indigo-bright); font-weight: 600; }
.token-help ol { margin: 12px 0 0; padding-left: 20px; }
.token-help li { margin-bottom: 6px; }
.token-note { font-size: 0.82rem; color: var(--text-dim); margin: 10px 0 0; }

.modal-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---------- toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease;
  max-width: 340px;
}
.toast.success { border-left-color: var(--teal); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--indigo); }
.toast.hide { animation: fadeOut 0.3s ease forwards; }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .token-status { display: inline-flex; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 820px) {
  .header-nav { display: flex; }
  .header-actions { margin-left: 8px; }
  .form-section { padding: 36px 38px; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: start; }
  .footer-brand { grid-column: auto; }
}

/* noscript */
.noscript-note {
  background: var(--warn);
  color: #1a1300;
  text-align: center;
  padding: 10px;
  font-weight: 600;
}
