/*
 * GroupsSUITE — shared design-system foundation (CI).
 *
 * Canonical tokens + base app-shell + self-hosted @font-face + the GroupsSUITE
 * shell chrome (navy sidebar + light content + navy auth screen). Values are
 * taken 1:1 from GroupsLINK (gl-shared.jsx GLSidebar, gl-vermieter.jsx shell,
 * App.jsx login). Module-agnostic so it can be extracted into a shared package;
 * a module customises the look by overriding ONE token, --accent.
 *
 * Fonts are self-hosted (app/assets/fonts, served & fingerprinted by Propshaft)
 * — no external CDN, no font-src needed in the CSP.
 */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/Geist-Variable-b11a6485.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/GeistMono-Variable-6dd1dc09.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/InstrumentSerif-Regular-6c5b1c87.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/InstrumentSerif-Italic-126f9d71.woff2") format("woff2");
}

:root {
  /* Type families */
  --font-sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  /* Type scale — anchored at 14px (no 20px display bump) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;

  /* Shell backgrounds */
  --bg-shell: #0f172a;            /* navy app / auth background */
  --shell-content-bg: #f8fafc;    /* light content canvas */

  /* Sidebar (navy) — GroupsLINK GLSidebar values */
  --sidebar-bg: #1e2d42;
  --sidebar-border: #2a3a52;
  --sidebar-hover: #2a3a52;
  --sidebar-active-bg: #243558;
  --sidebar-ink: #c9d3e0;
  --sidebar-ink-muted: #8fa3bc;
  --sidebar-ink-strong: #f1f5f9;

  /* Topbar */
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;

  /* Light content surfaces */
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-subtle: #f9fafb;

  /* Text */
  --ink: #111827;
  --ink-muted: #6b7280;
  --ink-faint: #9ca3af;

  /* Borders */
  --border: #e5e7eb;
  --border-dark: #334155;

  /* Colour hierarchy */
  --primary: #1e3a8f;        /* primary actions (GroupsLINK navy) */
  --primary-hover: #1a336f;
  --primary-ink: #ffffff;

  --accent: #6dc30e;         /* DEFAULT module accent — overridden per module */
  --accent-ink: #ffffff;

  --brand-green: #6dc30e;    /* Groups brand mark (logo / wordmark) */

  /* Status */
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  /* Radii & elevation */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --pill: 9999px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 10px 25px rgba(2, 6, 23, 0.12);
}

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

html,
body {
  margin: 0;
  padding: 0;
  /* Navy base on BOTH html and body so no light/white default can ever show
     through (canvas, scroll, overscroll). No height:100% — it pins body to the
     viewport and lets taller content overflow; we use min-height instead. */
  background: var(--bg-shell);
}

/* Logged-out auth context: the body itself is a full-height navy screen,
   fully separated from the (light) app-shell content. min-height:100dvh covers
   the whole viewport incl. below the card and the footer, mobile bars included. */
body.gm-auth { min-height: 100dvh; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
button,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Motion */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
.fade-in { animation: fadeIn 280ms ease both; }

/* Compact SaaS scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ====================================================================== */
/* GroupsSUITE shell — logged-in chrome (navy sidebar + light content)    */
/* ====================================================================== */
.gl-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.gl-sidebar {
  width: 220px;
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
}

.gl-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.gl-sidebar__logo {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  border-radius: 5px;
  object-fit: contain;
  object-position: center top;
  background: #fff;
  padding: 2px;
}

.gl-sidebar__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sidebar-ink-strong);
}

.gl-sidebar__subtitle {
  font-size: 11px;
  color: var(--sidebar-ink-muted);
}

.gl-sidebar__nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.gl-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  padding: 7px 10px;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--sidebar-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: all 80ms;
}

.gl-nav-item:not(.is-disabled):hover { background: var(--sidebar-hover); }

.gl-nav-item.is-active {
  background: var(--sidebar-active-bg);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Disabled placeholder items: muted-but-light (legible on navy), NOT dimmed via
   opacity which muddies the text/icon. Icon uses currentColor, so it follows. */
.gl-nav-item.is-disabled { color: var(--sidebar-ink-muted); cursor: default; }

/* Let a long label ellipsis-truncate so the "soon" tag stays fully visible
   inside the fixed 220px sidebar. */
.gl-nav-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gl-nav-item__tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--pill);
  background: var(--sidebar-hover);
  color: var(--sidebar-ink);
}

.gl-sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.gl-sidebar__avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-ink);
}

.gl-sidebar__user-meta { flex: 1; min-width: 0; }

.gl-sidebar__user-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-sidebar__logout {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--sidebar-ink-muted);
  padding: 2px;
  display: inline-flex;
  align-items: center;
}
.gl-sidebar__logout:hover { color: var(--sidebar-ink-strong); }

.gl-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--shell-content-bg);
}

.gl-topbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
}

.gl-topbar__title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
}

.gl-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ====================================================================== */
/* GroupsSUITE auth screen — logged-out navy landing                      */
/* ====================================================================== */
.gl-auth {
  position: relative;
  min-height: 100vh;       /* fallback */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-shell);
}

.gl-auth__locale { position: absolute; top: 16px; right: 20px; }

.gl-auth__inner { width: 100%; max-width: 420px; }

.gl-auth__brand { text-align: center; margin-bottom: 32px; }

.gl-auth__logo { width: 140px; object-fit: contain; }

.gl-auth__title {
  font-family: var(--font-serif);
  font-size: 30px;
  color: #fff;
  margin: 18px 0 4px;
}

.gl-auth__subtitle { font-size: 13px; color: var(--ink-muted); }

.gl-auth__footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: #4b5563;
}
