/* ═══════════════════════════════════════════════════════════════
   Portal — Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Design System (siehe /DESIGN_SYSTEM.md) ── */
  --bg: #EBF4F9;           /* App-Hintergrund (hellblau wie Argus) */
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text: #0D0D0D;         /* Argus-Primary schwarz */
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.10);
  --shadow-glow: 0 0 60px rgba(37,99,235,0.08);
  --radius: 16px;          /* rounded-2xl */
  --radius-sm: 12px;       /* rounded-xl */
  --radius-pill: 100px;
  --grid-color: rgba(15,23,42,0.025);
  --glow-1: rgba(37,99,235,0.06);   /* Argus blue */
  --glow-2: rgba(13,13,13,0.04);    /* Argus black */
  --glow-3: rgba(37,99,235,0.04);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-card: #111827;
  --bg-elevated: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --border-hover: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 80px rgba(37,99,235,0.14);
  --grid-color: rgba(255,255,255,0.02);
  --glow-1: rgba(37,99,235,0.10);
  --glow-2: rgba(99,102,241,0.07);
  --glow-3: rgba(37,99,235,0.06);
}

/* ── Reset & Base ────────────────────────────────────────────── */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated Background ─────────────────────────────────────── */

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
  width: 600px; height: 600px;
  background: var(--glow-1);
  top: -200px; right: -100px;
  animation-delay: 0s;
}

.bg-glow-2 {
  width: 500px; height: 500px;
  background: var(--glow-2);
  bottom: -150px; left: -100px;
  animation-delay: -7s;
}

.bg-glow-3 {
  width: 400px; height: 400px;
  background: var(--glow-3);
  top: 40%; left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(15px, 15px) scale(1.02); }
}

/* ── Container ───────────────────────────────────────────────── */

.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────── */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 32px;
  animation: fadeDown 0.6s ease;
}

.header-left { display: flex; align-items: center; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-icon:hover {
  transform: rotate(8deg) scale(1.05);
  box-shadow: var(--shadow-md);
}

.logo-text { display: flex; flex-direction: column; }

.logo-brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s ease;
}

.user-pill:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #0D0D0D;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.user-name {
  white-space: nowrap;
}

.theme-toggle {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  color: var(--text);
  transform: scale(1.05);
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
:root .icon-sun, body:not([data-theme="dark"]) .icon-sun { display: none; }
:root .icon-moon, body:not([data-theme="dark"]) .icon-moon { display: block; }

/* ── Welcome ─────────────────────────────────────────────────── */

.welcome {
  text-align: center;
  padding: 48px 0 40px;
  animation: fadeUp 0.7s ease 0.1s both;
}

.welcome-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.welcome-sub {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

#greetName {
  color: #2563EB; /* Argus-Akzent-Blau für persönliche Note ohne Gradient */
}

/* ── App Grid ────────────────────────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  flex: 1;
  animation: fadeUp 0.8s ease 0.2s both;
}

.app-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
}

.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-light), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

[data-theme="dark"] .app-card::before {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
}

.app-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent);
  transform: translateY(-4px);
}

.app-card:hover::before { opacity: 1; }

.app-card:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.app-icon {
  position: relative;
  z-index: 1;
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover .app-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}

.app-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.app-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}

.app-arrow {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.app-card:hover .app-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* ── Status Bar ──────────────────────────────────────────────── */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  animation: fadeUp 0.9s ease 0.3s both;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: pulse 2.5s ease-in-out infinite;
}

.status-sep { opacity: 0.4; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16,185,129,0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 4px rgba(16,185,129,0.2); }
}

/* ── Animations ──────────────────────────────────────────────── */

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .container { padding: 20px 16px 32px; }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .app-card { padding: 20px; }

  .welcome { padding: 32px 0 28px; }

  .header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .user-name { display: none; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .app-grid { gap: 14px; }
}
