/* ════════════════════════════════════════════════════
   Motorakte – Haupt-Stylesheet
   Design: App-authentisch, dunkel, automotive
   ════════════════════════════════════════════════════ */

/* ─── Custom Properties ─────────────────────────────── */
:root {
  /* Farben – direkt aus der App (MainActivity.java) */
  --bg-base:          #0f1115;   /* bg  = Color.rgb(15,17,21) */
  --bg-elevated:      #14171d;   /* bg2 = Color.rgb(20,23,29) */
  --bg-card:          #191d24;   /* surface */
  --bg-card-hover:    #22272f;   /* surface2 */
  --bg-surface3:      #2a303a;   /* surface3 */
  --bg-input:         #191d24;

  --border-subtle:    rgba(255,255,255,0.04);
  --border-default:   rgba(255,255,255,0.07);
  --border-focus:     rgba(123,211,196,0.55);

  --text-primary:     #f4f6f8;   /* text  = Color.rgb(244,246,248) */
  --text-secondary:   #c6ccd3;   /* text2 = Color.rgb(198,204,211) */
  --text-muted:       #808892;   /* muted = Color.rgb(128,136,146) */
  --text-accent:      #7bd3c4;

  /* App-Akzentfarben */
  --accent:           #7bd3c4;   /* accent  = teal/mint */
  --accent-hover:     #9de8dc;
  --accent-dim:       rgba(123,211,196,0.10);
  --accent-glow:      rgba(123,211,196,0.18);
  --accent-glow-lg:   rgba(123,211,196,0.06);

  --accent2:          #57a8ff;   /* accent2 = blue */
  --accent2-dim:      rgba(87,168,255,0.10);

  --success:          #34d399;   /* ok  = Color.rgb(52,211,153) */
  --success-dim:      rgba(52,211,153,0.10);
  --error:            #f87171;   /* err = Color.rgb(248,113,113) */
  --error-dim:        rgba(248,113,113,0.10);
  --warning:          #fbbf24;   /* warn */

  /* Schrift */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Abstände */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* Radien */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 16px;  --r-xl: 24px;

  /* Schatten */
  --shadow-card:     0 0 0 1px var(--border-default), 0 4px 32px rgba(0,0,0,0.5);
  --shadow-elevated: 0 0 0 1px var(--border-subtle), 0 8px 48px rgba(0,0,0,0.6);
  --shadow-accent:   0 8px 40px var(--accent-glow), 0 0 80px var(--accent-glow-lg);
  --shadow-btn:      0 4px 20px rgba(123,211,196,0.28);

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.25s ease;

  --container: 1200px;
}

/* ─── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; }

/* ─── Hintergrund-Effekte ───────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(123,211,196,0.09) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

/* ─── Layout ────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ─── Header ────────────────────────────────────────── */
.site-header {
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  background: rgba(15,17,21,0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: fit-content;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.logo-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(123,211,196,0.2);
  padding: 2px 8px;
  border-radius: 99px;
}

.header-platform {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Hero ──────────────────────────────────────────── */
.hero {
  flex: 1;
  padding: var(--sp-20) 0 var(--sp-16);
}

.hero-center {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.02em;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: 5px 12px;
  border-radius: 99px;
}

.dot-live {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: block;
  position: relative;
}

.dot-live::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%       { transform: scale(1.6); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: var(--sp-5);
}

.text-accent { color: var(--accent); }
.text-accent2 { color: var(--accent2); }

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-10);
  max-width: 480px;
}

/* ─── Key-Card ──────────────────────────────────────── */
.key-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.key-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(123,211,196,0.25), transparent);
}

.input-row {
  display: flex;
  gap: var(--sp-3);
  align-items: stretch;
}

.key-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 14px var(--sp-4);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}

.key-input::placeholder { color: var(--text-muted); letter-spacing: 0.04em; font-size: 0.9rem; }

.key-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(123,211,196,0.10);
}

.key-input.input-error {
  border-color: rgba(248,113,113,0.5);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.08);
}

/* ─── Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--accent);
  color: #0a0d11;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 14px var(--sp-6);
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px rgba(123,211,196,0.38);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: none; }

/* ─── Input Messages ────────────────────────────────── */
.input-message {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.input-message--error {
  color: var(--error);
  background: var(--error-dim);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
}

.input-message--error svg { flex-shrink: 0; margin-top: 1px; }

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--sp-3);
  text-align: center;
}

.features-section {
  padding: var(--sp-12) 0 var(--sp-16);
  border-top: 1px solid var(--border-subtle);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: border-color var(--t-normal), transform var(--t-normal), background var(--t-normal);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  border-color: rgba(123,211,196,0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px; height: 44px;
  background: var(--accent-dim);
  border: 1px solid rgba(123,211,196,0.18);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
  color: var(--accent);
}

.feature-icon.blue {
  background: var(--accent2-dim);
  border-color: rgba(87,168,255,0.18);
  color: var(--accent2);
}

.feature-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── Stats Strip ───────────────────────────────────── */
.stats-strip {
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--border-subtle);
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stat-item {
  background: var(--bg-card);
  padding: var(--sp-6) var(--sp-8);
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-family: var(--font-mono);
  display: block;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* ─── Footer ────────────────────────────────────────── */
.site-footer {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border-subtle);
}

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

.footer-copy { font-size: 0.8125rem; color: var(--text-muted); }
.footer-note { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; margin-top: var(--sp-1); }
.footer-android {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: 8px 14px;
  border-radius: 99px;
}

/* ═══════════════════════════════════════════════════════
   Download-Seite
   ═══════════════════════════════════════════════════════ */

.download-page {
  flex: 1;
  padding: var(--sp-12) 0 var(--sp-16);
}

.success-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  background: var(--success-dim);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-8);
}

.success-icon {
  width: 52px; height: 52px;
  background: rgba(52,211,153,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  flex-shrink: 0;
}

.success-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.success-sub { font-size: 0.875rem; color: var(--text-secondary); }

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
}

.dl-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}

.version-info { margin-bottom: var(--sp-6); }

.version-badge {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.version-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.version-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.version-size, .version-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: var(--accent);
  color: #0a0d11;
  font-size: 1rem;
  font-weight: 700;
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-btn);
  width: 100%;
  text-align: center;
  margin-bottom: var(--sp-4);
}

.btn-download:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 32px rgba(123,211,196,0.38);
  transform: translateY(-1px);
  color: #0a0d11;
}

.android-note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.no-version {
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.install-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.install-steps li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.step-num {
  width: 26px; height: 26px;
  background: var(--accent-dim);
  border: 1px solid rgba(123,211,196,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content { display: flex; flex-direction: column; gap: 2px; }
.step-content strong { font-size: 0.875rem; color: var(--text-primary); font-weight: 600; }
.step-content span { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }

.security-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
}

.changelog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sp-5);
}

.changelog-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

.session-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; gap: var(--sp-4); text-align: center; }
}

@media (max-width: 768px) {
  .hero { padding: var(--sp-14) 0 var(--sp-10); }
  .hero-title { font-size: 2.25rem; }
  .input-row { flex-direction: column; }
  .btn-primary { width: 100%; justify-content: center; }
  .download-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--sp-4); }
  .features-grid { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.875rem; }
  .hero-subtitle br { display: none; }
  .success-banner { flex-direction: column; text-align: center; }
}
