* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: #1a202c;
}

/* Auth-Pages: zentriert auf Gradient */
body.layout-auth {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}
body.layout-auth main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100%;
  max-width: none;
}
body.layout-auth main > .card,
body.layout-auth main > .flash {
  width: 100%;
  max-width: 420px;
}

/* App-Pages: helles Layout mit Navbar */
body.layout-app {
  background: #f7fafc;
  min-height: 100vh;
}

/* Landing-Page: Full-Width mit dunklem Hero */
body.layout-landing {
  background: white;
  min-height: 100vh;
}
body.layout-landing main { display: block; padding: 0; }

.navbar-transparent {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.brand-light { color: white; }
.nav-link-light {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}
.nav-link-light:hover { color: white; }
.nav-btn {
  background: white;
  color: #5a67d8;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 140px 20px 100px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 20px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto 36px;
  max-width: 640px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.btn-primary-lg {
  background: white;
  color: #5a67d8;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}
.btn-ghost-lg {
  background: transparent;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  display: inline-block;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost-lg:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}
.hero-example {
  margin-top: 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}
.hero-example code {
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  color: white;
  font-size: 13px;
}
.hero-short {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #5a67d8 !important;
  font-weight: 700;
}

@media (max-width: 640px) {
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16px; }
  .hero { padding: 110px 20px 70px; }
}

/* Section title */
.section-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 48px;
  letter-spacing: -0.02em;
  color: #1a202c;
}

/* Features */
.features { padding: 90px 20px; background: #f7fafc; }
.features-inner { max-width: 1100px; margin: 0 auto; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature {
  background: white;
  padding: 28px 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature h3 { margin: 0 0 8px; font-size: 18px; color: #1a202c; }
.feature p { margin: 0; color: #4a5568; font-size: 15px; line-height: 1.5; }

/* Sponsor section */
.sponsor {
  background: linear-gradient(135deg, #fef5e7, #fce8d3);
  padding: 70px 20px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.sponsor-inner {
  max-width: 640px;
  margin: 0 auto;
}
.sponsor-eyebrow {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #b7791f;
  font-weight: 700;
  margin-bottom: 8px;
}
.sponsor-name {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #1a202c;
  letter-spacing: -0.02em;
}
.sponsor-text {
  font-size: 17px;
  line-height: 1.6;
  color: #4a5568;
  margin: 0 0 24px;
}
.sponsor-text a { color: #b7791f; font-weight: 600; text-decoration: none; }
.sponsor-text a:hover { text-decoration: underline; }
.sponsor-link {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  background: #1a202c;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sponsor-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* Footer sponsor mention */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.footer-sponsor { color: #a0aec0; font-size: 13px; }
.footer-sponsor a { color: #cbd5e0; text-decoration: none; }
.footer-sponsor a:hover { color: white; }

.footer-mini-sponsor a { color: #667eea; text-decoration: none; }
.footer-mini-sponsor a:hover { text-decoration: underline; }
.footer-mini-sep { color: #cbd5e0; }
body.layout-auth .footer-mini-sponsor { color: rgba(255, 255, 255, 0.75); }
body.layout-auth .footer-mini-sponsor a { color: white; }
body.layout-auth .footer-mini-sep { color: rgba(255, 255, 255, 0.4); }

/* How it works */
.how { padding: 90px 20px; background: white; }
.how-inner { max-width: 1000px; margin: 0 auto; }
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 56px;
}
.step { text-align: center; }
.step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { margin: 0 0 8px; font-size: 18px; color: #1a202c; }
.step p { margin: 0; color: #4a5568; font-size: 15px; line-height: 1.5; }
.how-cta { text-align: center; }
.how-cta .btn-primary-lg {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

/* Legal pages */
.legal-page {
  background: #f7fafc;
  padding: 80px 20px 60px;
  min-height: calc(100vh - 200px);
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
  background: white;
  padding: 48px 48px 56px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
  color: #2d3748;
}
.legal-inner h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.01em;
}
.legal-inner h2 {
  margin: 36px 0 12px;
  font-size: 20px;
  color: #1a202c;
}
.legal-inner h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  color: #2d3748;
}
.legal-inner p { margin: 0 0 14px; }
.legal-inner ul { margin: 0 0 14px; padding-left: 22px; }
.legal-inner li { margin-bottom: 4px; }
.legal-inner code {
  background: #edf2f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #2d3748;
}
.legal-inner a { color: #667eea; text-decoration: underline; }
.legal-back {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.forbidden-list { padding-left: 22px; }
.forbidden-list li { margin-bottom: 10px; }

.abuse-link {
  display: inline-block;
  background: #fed7d7;
  color: #742a2a !important;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
}
.abuse-link:hover { background: #fc8181; color: white !important; }

.abuse-email {
  text-align: center;
  font-size: 18px;
  margin: 20px 0;
}
.abuse-email a {
  display: inline-block;
  background: #1a202c;
  color: white !important;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  font-size: 14px;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 3px 0 0;
  flex-shrink: 0;
}
.checkbox-row span { line-height: 1.4; }

.qr-wrap {
  text-align: center;
  padding: 16px;
  background: #f7fafc;
  border-radius: 10px;
  margin: 12px 0;
}
.qr-wrap img { border-radius: 8px; }
.secret-box {
  text-align: center;
  background: #edf2f7;
  padding: 12px;
  border-radius: 6px;
  font-size: 15px;
  letter-spacing: 0.05em;
}
.backup-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.backup-code {
  display: block;
  background: #1a202c;
  color: #68d391;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.03em;
}
.backup-toggle {
  margin-top: 16px;
  font-size: 14px;
  color: #4a5568;
}
.backup-toggle summary { cursor: pointer; padding: 8px 0; }
.backup-toggle[open] summary { margin-bottom: 8px; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mini footer (für auth/app Seiten) */
.footer-mini {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #a0aec0;
}
.footer-mini-inner { display: flex; gap: 20px; justify-content: center; }
.footer-mini a { color: #a0aec0; text-decoration: none; }
.footer-mini a:hover { color: #667eea; }
body.layout-auth .footer-mini a { color: rgba(255, 255, 255, 0.7); }
body.layout-auth .footer-mini a:hover { color: white; }

/* Footer */
.footer {
  background: #1a202c;
  color: #a0aec0;
  padding: 32px 20px;
  font-size: 14px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #a0aec0; text-decoration: none; }
.footer-links a:hover { color: white; }

.container {
  width: 100%;
  max-width: 420px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Navbar */
.navbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: #1a202c;
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links a {
  color: #4a5568;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: #667eea; }
.nav-email { color: #a0aec0; font-size: 13px; }
.btn-link {
  background: none;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.card-wide {
  background: white;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

/* Headings */
h1 { margin: 0 0 16px; font-size: 24px; }
h2 { margin: 0 0 14px; font-size: 18px; color: #2d3748; }
p { color: #4a5568; line-height: 1.5; }
.muted { color: #a0aec0; font-size: 14px; }

/* Forms */
label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: #2d3748;
  font-weight: 500;
}
label small {
  display: block;
  color: #a0aec0;
  font-weight: 400;
  margin-top: 4px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="datetime-local"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  transition: border-color 0.15s;
  font-family: inherit;
}
input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

button, .button {
  display: inline-block;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: #667eea;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s;
}
button:hover, .button:hover { background: #5a67d8; }

.card button:not(.btn-link):not(.button-secondary):not(.button-danger) {
  width: 100%;
  margin-top: 8px;
}

.button-secondary {
  background: #edf2f7;
  color: #2d3748;
}
.button-secondary:hover { background: #e2e8f0; }

.button-danger {
  background: #fed7d7;
  color: #742a2a;
}
.button-danger:hover { background: #feb2b2; }

.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; margin: 0; }
form.inline button { padding: 6px 12px; font-size: 13px; }

.links {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}
.links a { color: #667eea; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.links span { color: #cbd5e0; margin: 0 8px; }

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.page-header h1 { margin: 0; }
.page-header .actions { display: flex; gap: 8px; align-items: center; }

/* Flash */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.flash-error   { background: #fed7d7; color: #742a2a; border: 1px solid #fc8181; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  color: #4a5568;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 10px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table a { color: #667eea; text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.truncate-inline {
  display: inline-block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.actions { white-space: nowrap; text-align: right; }
.badge {
  display: inline-block;
  font-size: 12px;
  margin-left: 4px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a0aec0;
  margin-bottom: 6px;
}
.stat-value { font-size: 32px; font-weight: 700; color: #1a202c; }
.stat-value-sm { font-size: 14px; color: #2d3748; }

/* Sparkline */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  margin: 12px 0 8px;
}
.sparkline .bar {
  flex: 1;
  background: linear-gradient(180deg, #667eea, #764ba2);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #a0aec0;
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Empty state */
.empty {
  background: white;
  border-radius: 10px;
  padding: 60px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Admin */
.nav-admin {
  background: #fed7d7;
  color: #742a2a !important;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600 !important;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.badge-on {
  display: inline-block;
  background: #c6f6d5;
  color: #22543d;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-off {
  display: inline-block;
  background: #fed7d7;
  color: #742a2a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-admin {
  display: inline-block;
  background: #fefcbf;
  color: #744210;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}
.row-suspended td { opacity: 0.5; }
.row-suspended td:last-child { opacity: 1; }
.actions form.inline + form.inline { margin-left: 4px; }
.actions .button-secondary, .actions .button-danger {
  padding: 6px 10px;
  font-size: 12px;
}

/* Token reveal */
.token-reveal { background: #fffbea; border: 1px solid #faf089; }
.token-value {
  display: block;
  padding: 12px 14px;
  background: #1a202c;
  color: #68d391;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-all;
  margin-top: 8px;
}

/* Code blocks */
pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
pre code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
