/* Techex Lab shared design language. SOURCE OF TRUTH for the token set used by
   the portal, accessflow, and the Authentik custom.css. Palette follows
   txprice/americasfunnel; Fira Sans is the Techex brand typeface. Light and
   dark follow the system preference. Rule: no left-edge accent strips. */

@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/FiraSans-Light.woff2) format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/FiraSans-Regular.woff2) format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/FiraSans-SemiBold.woff2) format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/FiraSans-Bold.woff2) format("woff2");
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --text: #1d2433;
  --muted: #6b7382;
  --accent: #2563eb;
  --accent-2: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.12);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 8px 24px rgba(16, 24, 40, 0.12);
  --radius: 12px;
  --radius-sm: 10px;
  color-scheme: light;
}

/* Dark applies when the system asks for it, unless light was chosen explicitly,
   and always when dark was chosen explicitly. theme.js sets data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1226;
    --surface: #111d3a;
    --surface-2: #16244a;
    --border: #2a3a5f;
    --text: #e8edf7;
    --muted: #8593b3;
    --accent: #5b9bff;
    --accent-2: #3fb950;
    --focus-ring: 0 0 0 3px rgba(91, 155, 255, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1226;
  --surface: #111d3a;
  --surface-2: #16244a;
  --border: #2a3a5f;
  --text: #e8edf7;
  --muted: #8593b3;
  --accent: #5b9bff;
  --accent-2: #3fb950;
  --focus-ring: 0 0 0 3px rgba(91, 155, 255, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Fira Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* Layout */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

.topbar .brand img { height: 26px; display: block; }
.topbar .spacer { flex: 1; }

/* The brand wordmark is white and disappears on a light surface; the purple
   wordmark is published alongside it. Swap it in wherever the surface is light. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .topbar .brand img,
  :root:not([data-theme="dark"]) .panel .logo {
    content: url(https://auth.techexlab.com/media/public/branding/techexlab-logo-purple.png);
  }
}

:root[data-theme="light"] .topbar .brand img,
:root[data-theme="light"] .panel .logo {
  content: url(https://auth.techexlab.com/media/public/branding/techexlab-logo-purple.png);
}

/* Theme switch */
.theme-toggle {
  min-width: 74px;
  text-align: center;
}

.userchip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.userchip .who { font-weight: 600; }
.userchip .mail { color: var(--muted); font-size: 12.5px; }

/* Cards and grids */
.section-title {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--text);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

a.card { text-decoration: none; }
a.card:hover { box-shadow: var(--shadow-lift); border-color: var(--accent); text-decoration: none; }

.card .icon {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
  background: var(--surface-2);
}

.card .icon-fallback {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(115deg, #001746 0%, #4f057d 100%);
}

.card h3 { font-size: 14.5px; }
.card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

/* Buttons and inputs */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 650;
}
.btn-primary:hover { filter: brightness(1.07); color: #fff; }

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

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
label { font-weight: 600; display: block; margin: 14px 0 6px; }

/* Notices */
.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
}
.notice-ok { border-color: var(--accent-2); }
.notice-err { border-color: var(--danger); }

/* Footer */
.footer {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--muted);
  font-size: 13px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
