/* 404scout — Stylesheet (bewusst handgeschrieben statt Tailwind: eine Datei,
   kein Build-Schritt; Design-Tokens oben) */

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

:root {
  --bg: #0b1220;
  --bg-alt: #0e1729;
  --card: #111c31;
  --border: #1e2a44;
  --text: #e6edf7;
  --text-dim: #93a1b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1080px, 100% - 3rem);
  margin-inline: auto;
}

.container-narrow {
  width: min(720px, 100% - 3rem);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  line-height: 1.2;
}

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

code {
  padding: 0.1em 0.4em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

/* --- Header & Footer -------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo:hover {
  text-decoration: none;
}

.logo-404 {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-dim);
  font-weight: 500;
}

.header-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--text-dim);
}

/* --- Buttons ------------------------------------------------ */

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-strong);
  color: #06131f;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-disabled {
  background: var(--card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: default;
}

/* --- Hero --------------------------------------------------- */

.hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--bg-alt), var(--bg));
  padding-block: 5.5rem 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  max-width: 42rem;
  margin-inline: auto;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 36rem;
  margin: 1.25rem auto 2rem;
}

.scan-form {
  display: flex;
  gap: 0.6rem;
  max-width: 34rem;
  margin-inline: auto;
}

.scan-form input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.scan-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-error {
  color: var(--danger);
  margin-top: 1rem;
  font-weight: 500;
}

.trust-line {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  margin-top: 1.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.trust-line li::before {
  content: "✓ ";
  color: var(--ok);
}

/* --- Sektionen ---------------------------------------------- */

.section {
  padding-block: 4.5rem;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin-bottom: 2.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.card p {
  color: var(--text-dim);
}

/* --- Schritte ------------------------------------------------ */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step {
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #06131f;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.step p {
  color: var(--text-dim);
}

/* --- Preise -------------------------------------------------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.plan {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.12);
}

.plan h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.plan-price {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
}

.plan-period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
}

.plan-features {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  color: var(--text-dim);
}

.plan-features li::before {
  content: "✓ ";
  color: var(--accent);
}

/* --- FAQ ------------------------------------------------------ */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin-top: 0.75rem;
  color: var(--text-dim);
}

/* --- Scan-Seite ---------------------------------------------- */

.scan-page {
  padding-block: 3.5rem 4.5rem;
}

.scan-eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.scan-url {
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  margin: 0.4rem 0 2rem;
  word-break: break-all;
}

.progress-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-status {
  font-size: 1.15rem;
}

.progress-status strong {
  font-variant-numeric: tabular-nums;
}

.progress-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* --- Ergebnisse ----------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-broken { background: var(--danger); }
.dot-warn { background: var(--warn); }

/* Health-Note */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  color: #06131f;
  flex-shrink: 0;
}

.grade-sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.9rem;
  vertical-align: middle;
}

.grade-a { background: var(--ok); }
.grade-b { background: #a3e635; }
.grade-c { background: var(--warn); }
.grade-d { background: #fb923c; }
.grade-f { background: var(--danger); }

.grade-tile {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.archive-link {
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.archive-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.reopened-hint {
  color: var(--warn);
}

.orphan-note {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.orphan-note summary {
  cursor: pointer;
  color: var(--text-dim);
}

.orphan-note ul {
  margin-top: 0.6rem;
}

.notify-form {
  margin-top: 2rem;
  max-width: 30rem;
}

.notify-hint {
  margin-top: 2rem;
  color: var(--ok);
}

.notify-privacy {
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.results-heading {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.results-sub {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.95rem;
  margin-left: 0.5rem;
}

.target-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.target-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.target-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.target-url {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  flex: 1;
  min-width: 12rem;
}

.badge {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-broken {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.badge-kind {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  font-weight: 500;
}

.occurrences {
  list-style: none;
  margin-top: 0.6rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: grid;
  gap: 0.2rem;
}

.occ-page {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-all;
}

.occ-more {
  font-style: italic;
}

.target-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.cta-box {
  margin-top: 1.75rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.03));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cta-box p {
  flex: 1;
  min-width: 16rem;
}

.happy-box {
  background: var(--card);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  display: grid;
  gap: 0.9rem;
  justify-items: center;
}

.happy-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ok);
}

.warning-note {
  margin-top: 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.scan-meta {
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
}

.notice-error {
  border-left-color: var(--danger);
  color: var(--text);
}

/* --- App (Dashboard, Arbeitsliste, Auth) ----------------------- */

.app-page {
  padding-block: 3rem 4.5rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.page-head h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.site-title {
  word-break: break-all;
}

.page-sub {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.site-card {
  color: var(--text);
  display: block;
}

.site-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.site-card-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--text-dim);
}

.site-card-stat.is-broken {
  color: var(--danger);
  font-weight: 600;
}

.dot-ok { background: var(--ok); }

.site-card-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.site-card-trend {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.unverified {
  color: var(--warn);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.tab {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  color: var(--text-dim);
  font-weight: 500;
  border: 1px solid transparent;
}

.tab:hover {
  text-decoration: none;
  color: var(--text);
}

.tab-active {
  background: var(--card);
  border-color: var(--accent);
  color: var(--text);
}

.tab-count {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.badge-warn {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.badge-ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.target-meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.recheck-hint {
  color: var(--accent);
}

.target-occurrences {
  margin-top: 0.5rem;
}

.target-occurrences summary {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-block {
  width: 100%;
}

.scan-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1rem;
}

.spinner-small {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border-width: 2px;
}

.messages {
  margin-top: 1.25rem;
}

.messages .notice {
  margin-bottom: 0.5rem;
}

.notice-success {
  border-left-color: var(--ok);
  color: var(--text);
}

/* Formulare (Django as_p) */
.styled-form p {
  margin-bottom: 1rem;
}

.styled-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.styled-form input[type="text"],
.styled-form input[type="url"],
.styled-form input[type="email"],
.styled-form input[type="password"],
.styled-form select {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.styled-form input:focus,
.styled-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.styled-form .helptext {
  display: block;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.styled-form .errorlist {
  list-style: none;
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.form-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-page {
  display: flex;
  justify-content: center;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: min(26rem, 100%);
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.auth-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: -0.75rem 0 1.25rem;
}

.auth-links {
  margin-top: 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.settings-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.settings-section h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.4rem;
}

.settings-section p {
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.verified-badge {
  color: var(--ok);
  font-weight: 600;
}

.danger-zone {
  border-color: rgba(248, 113, 113, 0.4);
}

.table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}

.history-table th,
.history-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-broken { color: var(--danger); font-weight: 600; }
.cell-ok { color: var(--ok); font-weight: 600; }

/* --- Statische Seiten ----------------------------------------- */

.static-page {
  padding-block: 3.5rem 4.5rem;
}

.static-page h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 1.5rem;
}

.static-page h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.static-page ul {
  margin: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-dim);
}

.static-page p {
  color: var(--text-dim);
  margin-block: 0.5rem;
}

/* --- Responsive ------------------------------------------------ */

@media (max-width: 560px) {
  .scan-form {
    flex-direction: column;
  }

  .hero {
    padding-block: 3.5rem 3rem;
  }
}
