/* ============================================================
   QUALITIMM — "Dark Matter" Design System
   Electric, Cosmic, Ultra-Clean — Mobile First
   ============================================================ */

:root {
  /* Hintergründe */
  --bg:            #050911;
  --bg-card:       #0a1628;
  --bg-elevated:   #0d1f3c;
  --bg-input:      #070e1c;

  /* Borders */
  --border:        #1a2e4a;
  --border-hover:  #1e3a5f;
  --border-focus:  #2563eb;

  /* Primär */
  --primary:       #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow:  rgba(37, 99, 235, 0.3);
  --accent:        #00d4ff;
  --purple:        #7c3aed;
  --purple-light:  #a78bfa;

  /* Status */
  --success:       #10b981;
  --success-bg:    rgba(16, 185, 129, 0.08);
  --warning:       #f59e0b;
  --warning-bg:    rgba(245, 158, 11, 0.08);
  --danger:        #ef4444;
  --danger-bg:     rgba(239, 68, 68, 0.08);

  /* Text */
  --text:          #e2e8f0;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  /* Shapes */
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  18px;

  /* Shadows */
  --shadow-card: 0 0 0 1px var(--border),
                 0 8px 32px rgba(0, 0, 0, 0.6),
                 inset 0 1px 0 rgba(255,255,255,0.03);
  --shadow-focus: 0 0 0 2px var(--primary), 0 0 20px var(--primary-glow);
  --shadow-btn:   0 4px 15px var(--primary-glow);
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Auth Layout ─────────────────────────────────────────── */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
    var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

/* Dezenter Glow-Streifen oben */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.6), rgba(124,58,237,0.4), transparent);
}

/* ── Logo ────────────────────────────────────────────────── */

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.logo-text {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.25));
}

.logo-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.auth-desc {
  color: var(--text-subtle);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.5;
}

.auth-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.auth-back {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 0.25rem;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--accent); }

/* ── Forms ───────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

input::placeholder { color: var(--text-muted); font-size: 0.9rem; }

/* Password Toggle */
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 3rem; }

.pw-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  -webkit-appearance: none;
}
.pw-toggle:hover { color: var(--accent); }

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
  cursor: pointer;
  user-select: none;
}
.form-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 3px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.78rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  -webkit-appearance: none;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text-subtle);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

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

.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.8rem; }

/* ── Alerts ──────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  border-width: 1px;
  border-style: solid;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: var(--danger-bg);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.15);
}
.alert-warning {
  background: var(--warning-bg);
  color: #fcd34d;
  border-color: rgba(245,158,11,0.15);
}
.alert-success {
  background: var(--success-bg);
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.15);
}
.alert-info {
  background: rgba(14,165,233,0.08);
  color: #7dd3fc;
  border-color: rgba(14,165,233,0.15);
}

/* Roter Banner — Forced PW Change */
.pw-change-banner {
  background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06));
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pw-change-banner p { font-size: 0.85rem; color: #fca5a5; flex: 1; }
.pw-change-banner .btn { flex-shrink: 0; font-size: 0.8rem; padding: 0.45rem 0.9rem; }

/* ── Status Dot ──────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }

/* ── Recovery Details ────────────────────────────────────── */
.recovery-details {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.recovery-details summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  padding: 0.3rem;
  transition: color 0.2s;
  list-style: none;
  outline: none;
}
.recovery-details summary:hover { color: var(--accent); }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* ── Glow Pulse Animation ────────────────────────────────── */
@keyframes glow-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius);
  }
  .logo-text { font-size: 1.8rem; }
}
