@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

/* ─────────────────────────────────────────────────────────────
   Vigo-Intra — Portal-Design
   Gleiche Palette wie VigoLager (Grün / Blau / Orange, dunkles
   Tannen-/Petrol-Paneel), gleiche Hell/Dunkel-Wahl (localStorage "vl-theme").
   ───────────────────────────────────────────────────────────── */
:root {
  --green: #1fa052;  --green-dk: #157a3e;
  --blue:  #2f6fe0;  --blue-dk:  #1f4fb0;
  --orange:#ef8a1c;  --red: #d64545;
  --dark:  #0e2a22;  --dark2: #123b52;

  --bg: #f3f6f4;  --surface: #ffffff;  --surface-alt: #f5faf7;
  --ink: #1b2420; --muted: #5d7065;  --faint: #8fa398;  --line: #dde6e0;
  --shadow: 0 1px 2px rgba(14,42,34,.06), 0 8px 24px rgba(14,42,34,.08);
  --shadow-lift: 0 2px 4px rgba(14,42,34,.08), 0 16px 40px rgba(14,42,34,.14);
  --radius: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --green: #35c777; --green-dk: #27a35f; --blue: #6a9cf2; --blue-dk: #3f72d6; --orange: #ffa23e; --red: #ef6464;
  --dark: #081712; --dark2: #0d2436;
  --bg: #0f1713; --surface: #17231d; --surface-alt: #1c2a23;
  --ink: #e8f1ec; --muted: #9fb3a8; --faint: #6c8278; --line: #2a3a32;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --green: #35c777; --green-dk: #27a35f; --blue: #6a9cf2; --blue-dk: #3f72d6; --orange: #ffa23e; --red: #ef6464;
    --dark: #081712; --dark2: #0d2436;
    --bg: #0f1713; --surface: #17231d; --surface-alt: #1c2a23;
    --ink: #e8f1ec; --muted: #9fb3a8; --faint: #6c8278; --line: #2a3a32;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { width: 20px; height: 20px; flex: none; }

/* Logo-Plakette (Logo ist grün auf transparent → braucht hellen Grund) */
.logo-chip { display: inline-flex; background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.logo-chip img { height: 34px; display: block; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); cursor: pointer;
  display: inline-grid; place-items: center; transition: color .15s, border-color .15s, transform .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--faint); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ═════════════════════ Login ═════════════════════ */
.login {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.brand-panel {
  position: relative; overflow: hidden; color: #eaf3ee;
  background:
    radial-gradient(ellipse at 0% 100%, rgba(31,160,82,.35) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, rgba(47,111,224,.30) 0%, transparent 50%),
    linear-gradient(150deg, #0e2a22 0%, #123b52 100%);
  padding: 44px 56px; display: flex; flex-direction: column;
}
.brand-panel .contours { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; pointer-events: none; }
.brand-panel > * { position: relative; }
.brand-head { display: flex; align-items: center; gap: 14px; }
.brand-body { margin: auto 0; max-width: 470px; padding: 48px 0; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: #8fe0b0;
}
.brand-body h1 { font-size: clamp(2.4rem, 4.2vw, 3.4rem); line-height: 1.05; margin: 12px 0 16px; letter-spacing: -.02em; font-weight: 700; }
.brand-body h1 span { color: #5fd895; }
.brand-body p.lead { font-size: 1.05rem; color: #c3d6cc; margin: 0 0 34px; max-width: 420px; }
.app-preview { display: grid; gap: 12px; }
.app-preview .row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10);
}
.app-preview .badge {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
}
.app-preview .badge.green { background: rgba(53,199,119,.18); color: #6fe3a3; }
.app-preview .badge.blue  { background: rgba(106,156,242,.20); color: #9cc0ff; }
.app-preview strong { display: block; font-size: .98rem; color: #fff; }
.app-preview small { color: #a9c0b4; font-size: .84rem; }
.brand-foot { font-size: .8rem; color: #8aa598; }

.signin-panel { display: flex; flex-direction: column; padding: 28px 40px; background: var(--bg); }
.signin-top { display: flex; justify-content: flex-end; }
.signin-wrap { margin: auto; width: 100%; max-width: 400px; padding: 24px 0; }
.signin-wrap h2 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -.01em; }
.signin-wrap .sub { color: var(--muted); margin: 0 0 28px; }

.btn-ms {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 52px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font: 600 1rem 'IBM Plex Sans', 'Segoe UI', sans-serif; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  text-decoration: none;
}
.btn-ms:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: var(--faint); text-decoration: none; }
.btn-ms:active { transform: translateY(0); }
.btn-ms:focus-visible, .app-card a:focus-visible, .theme-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn-ms[aria-disabled="true"] { opacity: .5; pointer-events: none; box-shadow: none; }

.sso-note { display: flex; gap: 10px; margin-top: 18px; color: var(--muted); font-size: .86rem; }
.sso-note .ico { color: var(--green); width: 18px; height: 18px; margin-top: 2px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 34px 0 16px; color: var(--faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.direct-links { display: grid; gap: 8px; }
.direct-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink);
  background: transparent; transition: background .15s, border-color .15s;
}
.direct-links a:hover { background: var(--surface); border-color: var(--faint); text-decoration: none; }
.direct-links a span small { display: block; color: var(--muted); font-size: .8rem; }
.direct-links a .ico { color: var(--faint); width: 18px; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-bottom: 20px; border: 1px solid; }
.alert-error { background: color-mix(in srgb, var(--red) 9%, var(--surface)); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--ink); }
.alert-info  { background: color-mix(in srgb, var(--orange) 10%, var(--surface)); border-color: color-mix(in srgb, var(--orange) 40%, transparent); color: var(--ink); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert code { font-family: 'IBM Plex Mono', monospace; font-size: .82em; }
.alert-ok { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 35%, transparent); }

/* ═════════════════════ Portal-Startseite ═════════════════════ */
.topbar { border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }
.topbar .logo-chip { padding: 5px 9px; border-radius: 10px; box-shadow: none; }
.topbar .logo-chip img { height: 26px; }
.topbar .title { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.topbar .theme-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #d6e6dd; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--blue)); color: #fff; font-weight: 700; font-size: .85rem;
}
.user-chip .who { line-height: 1.2; }
.user-chip .who small { display: block; color: #9fbcae; font-size: .78rem; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); color: #eaf3ee; font-size: .88rem; font-weight: 500;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.btn-ghost .ico { width: 17px; height: 17px; }

.hero { background: linear-gradient(120deg, #0e2a22 0%, #123b52 100%); color: #eaf3ee; }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 30px 24px 92px; }
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 8px 0 6px; letter-spacing: -.015em; }
.hero p { margin: 0; color: #bcd0c5; }

main.portal { max-width: 1120px; margin: -64px auto 0; padding: 0 24px 48px; }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.app-card {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 26px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.app-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.app-card.green { --accent: var(--green); }
.app-card.blue  { --accent: var(--blue); }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.app-card .head { display: flex; align-items: center; gap: 14px; }
.app-card .badge {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent);
}
.app-card .badge .ico { width: 26px; height: 26px; }
.app-card h2 { font-size: 1.3rem; margin: 0; letter-spacing: -.01em; }
.app-card .tag { color: var(--muted); font-size: .88rem; }
.app-card p { margin: 0; color: var(--muted); flex: 1; }
.app-card .actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.btn-open {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .95rem;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s ease, filter .15s;
}
:root[data-theme="dark"] .btn-open { color: #0b1712; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-open { color: #0b1712; } }
.btn-open:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
.btn-open .ico { width: 18px; height: 18px; }
.link-classic { font-size: .85rem; color: var(--muted); }
.link-classic:hover { color: var(--ink); }

.info-strip {
  margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center;
  padding: 16px 20px; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
}
.info-strip .ico { width: 18px; height: 18px; color: var(--green); vertical-align: -4px; margin-right: 6px; }
.info-strip code { font-family: 'IBM Plex Mono', monospace; font-size: .82rem; color: var(--ink); }

footer.portal-foot { max-width: 1120px; margin: 0 auto; padding: 0 24px 32px; color: var(--faint); font-size: .8rem; }

/* ═════════════════════ Responsive ═════════════════════ */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .brand-panel { padding: 28px 24px; }
  .brand-body { padding: 28px 0 8px; }
  .brand-body p.lead { margin-bottom: 20px; }
  .brand-foot { display: none; }
  .signin-panel { padding: 20px 16px 40px; }
  .signin-top { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 12px 16px; gap: 10px; }
  .topbar .title { display: none; }
  .user-chip .who { display: none; }
  .btn-ghost span { display: none; }
  .btn-ghost { padding: 0 10px; }
  .hero-inner { padding: 22px 16px 84px; }
  main.portal { padding: 0 16px 36px; }
  .apps { grid-template-columns: 1fr; }
  footer.portal-foot { padding: 0 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
