/* GCESI Landing – Palantir-Stil: Dunkelblau, High-Tech */

:root {
  --bg-deep: #0a0e17;
  --bg-card: #0d1321;
  --bg-elevated: #111827;
  --border: #1e3a5f;
  --accent: #3b82f6;
  --accent-dim: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

/* Dezentes SVG-Linienraster als Hintergrund auf #0a0e17 */
body {
  margin: 0;
  min-height: 100vh;
  background-color: #0a0e17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='none' stroke='%231e3a5f' stroke-opacity='0.08' stroke-width='0.5' d='M0 0h48M0 0v48'/%3E%3C/svg%3E");
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Status-Bar: bündig am oberen Rand, keine Lücken */
.status-bar {
  margin: 0;
  padding: 0;
}

.terminal-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.terminal-status .terminal-status__segment {
  margin-right: 0.5rem;
}

.terminal-status__loc--pending {
  color: #eab308;
  animation: loc-blink 0.6s ease-in-out infinite;
}

.terminal-status__loc--ok {
  color: var(--success);
}

@keyframes loc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* System-Toggle: [ LANG: DE ] – echter System-Toggle-Look */
.terminal-status .terminal-status__lang {
  cursor: pointer;
  color: var(--accent);
  text-decoration: none;
  border: none;
  background: none;
  padding: 0.15em 0.35em;
  font: inherit;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.terminal-status .terminal-status__lang:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.terminal-status .terminal-status__lang:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.logo {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Trust-Building-Ticker: LATEST INDEXED SHIFTS */
.ticker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--success);
  margin: 0.5rem 0;
  padding: 0.35rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker:empty {
  display: none;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

/* Terminal-Fenster: Monospace, blauer Glow-Rahmen + dezent pulsierender Rand */
.signal-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  padding: 0;
  margin: 0 0 2rem;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 24px var(--accent-glow),
    inset 0 1px 0 rgba(59, 130, 246, 0.08);
  overflow: hidden;
  animation: terminal-border-pulse 3s ease-in-out infinite;
  position: relative;
}

.signal-card--live {
  position: relative;
}

/* Scanline-Overlay: CRT-Look, halbtransparente horizontale Linien */
.signal-card__scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  border-radius: 8px;
}

/* Oberer Rand des Terminals: Label bündig ohne Abstand */
.signal-card .label.status-bar-edge {
  margin-top: 0;
  position: relative;
  z-index: 2;
}

/* System-Interruption (RELOADING_LOCALE_DATABASE) */
.system-interruption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #eab308;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

/* Flicker-Animation beim Sprachwechsel */
.terminal-flicker {
  animation: terminal-flicker 0.15s ease-in-out 3;
}

@keyframes terminal-flicker {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.85; filter: brightness(1.15); }
}

@keyframes terminal-border-pulse {
  0%, 100% { border-color: rgba(59, 130, 246, 0.4); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 24px var(--accent-glow), inset 0 1px 0 rgba(59, 130, 246, 0.06); }
  50%  { border-color: rgba(59, 130, 246, 0.8); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 32px var(--accent-glow), inset 0 1px 0 rgba(59, 130, 246, 0.12); }
}

.signal-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.signal-body {
  padding: 1.25rem 1.75rem;
}

.signal-body__inner {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0 2px;
  position: relative;
  z-index: 0;
}

.signal-body__inner .signal-content {
  flex: 1 1 100%;
}

.signal-content {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #a5d6ff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* Terminal-Overlay: dezenter Scanline + Flicker für CRT-Look (ganze Seite) */
.terminal-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  animation: flicker 8s ease-in-out infinite;
}

@keyframes flicker {
  0%, 90%, 100% { opacity: 1; }
  92% { opacity: 0.97; }
  94% { opacity: 1; }
  96% { opacity: 0.98; }
  98% { opacity: 1; }
}

/* Bloom / Röhrenmonitor-Textschatten – authentischer CRT-Glow */
.signal-content--bloom {
  text-shadow: 0 0 5px rgba(59, 130, 246, 0.7);
}

.signal-body__inner:has(.signal-content:empty) .signal-cursor {
  display: none;
}

.signal-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

/* Blinkender Cursor beim Typing-Effekt */
.signal-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}

.signal-cursor.is-typing {
  opacity: 1;
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

.cta-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.cta-block h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

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

.btn-primary.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

/* Paywall: System-Warnung bei Trial-Quota */
.paywall-msg {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #f87171;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

/* Dashboard ausgegraut bei Trial-Limit (Blur) – Paywall-Text und CTA bleiben scharf */
body.dashboard-trial-exceeded .container > header,
body.dashboard-trial-exceeded .signal-card .label,
body.dashboard-trial-exceeded .signal-body__inner .signal-content,
body.dashboard-trial-exceeded .signal-body__inner .signal-cursor {
  filter: blur(3px);
  opacity: 0.7;
  pointer-events: none;
}

body.dashboard-trial-exceeded .paywall-msg,
body.dashboard-trial-exceeded .cta-block {
  filter: none;
  opacity: 1;
}

/* CTA-Button mit Fokus-Glow bei Paywall */
.btn-primary.btn-primary--focus-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3);
  animation: cta-glow-pulse 1.5s ease-in-out infinite;
}

@keyframes cta-glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 28px rgba(59, 130, 246, 0.8), 0 0 50px rgba(59, 130, 246, 0.4); }
}

.error-msg {
  font-size: 0.85rem;
  color: #f87171;
  margin-top: 0.75rem;
}

/* Success-Page: API-Key-Anzeige */
.status-msg {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.key-area .key-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.key-box code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #a5d6ff;
  word-break: break-all;
}

.btn-copy {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-copy:hover {
  background: var(--accent);
  color: #fff;
}

.key-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.key-hint code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3rem;
  padding-bottom: 1rem;
}

.footer-legal {
  display: block;
  margin-top: 0.5rem;
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--accent);
  text-decoration: underline;
}
