/* ========================================================================
   GLEE IT PORTAL — UNIFIED DESIGN SYSTEM
   UI-1: foundations, typography, spacing, surfaces, controls and responsive UI
   ======================================================================== */

:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --text: #172033;
  --text-strong: #0f172a;
  --muted: #667085;
  --muted-2: #8a94a6;
  --line: #e4e8ef;
  --line-strong: #d5dce7;

  --primary: #111827;
  --primary-hover: #1f2937;
  --primary-2: #2563eb;
  --primary-2-hover: #1d4ed8;

  --success: #087443;
  --success-bg: #e8f7ef;
  --warning: #9a6700;
  --warning-bg: #fff6dc;
  --danger: #b42318;
  --danger-bg: #feeceb;
  --info: #175cd3;
  --info-bg: #eef4ff;

  --sidebar-bg: #0e1626;
  --sidebar-surface: #172238;
  --sidebar-text: #b9c3d2;
  --sidebar-text-active: #ffffff;
  --sidebar-line: rgba(255,255,255,.09);

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  --shadow-xs: 0 1px 2px rgba(16,24,40,.04);
  --shadow-sm: 0 4px 12px rgba(16,24,40,.05);
  --shadow-md: 0 10px 30px rgba(16,24,40,.06);
  --shadow-lg: 0 20px 60px rgba(16,24,40,.14);

  --focus-ring: 0 0 0 3px rgba(37,99,235,.16);
  --transition-fast: 140ms ease;
  --transition: 180ms ease;

  --tenant-primary: #0e1626;
  --tenant-secondary: #3b82f6;
}

html.dark {
  --bg: #0b1020;
  --surface: #121a2b;
  --surface-2: #0f1728;
  --surface-3: #1a2436;
  --text: #eef2f7;
  --text-strong: #ffffff;
  --muted: #9aa6b8;
  --muted-2: #7f8ca1;
  --line: #263247;
  --line-strong: #344158;
  --primary: #f8fafc;
  --primary-hover: #e2e8f0;
  --primary-2: #60a5fa;
  --primary-2-hover: #93c5fd;
  --success: #6ee7b7;
  --success-bg: #123527;
  --warning: #facc15;
  --warning-bg: #3a2f0a;
  --danger: #fca5a5;
  --danger-bg: #3a1717;
  --info: #93c5fd;
  --info-bg: #102a4c;
  --sidebar-bg: #080d18;
  --sidebar-surface: #131d30;
  --sidebar-line: rgba(255,255,255,.08);
}

/* ------------------------------------------------------------------------
   Base / reset
   ------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--primary-2); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--text-strong); letter-spacing: -.02em; }
h1 { font-size: clamp(28px, 3vw, 34px); line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.3; }
p { line-height: 1.65; }
small { font-size: 12px; }
code, pre { font-family: var(--font-mono); }
code { font-size: .86em; }

[hidden] { display: none !important; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.muted { color: var(--muted) !important; }
.muted-small { color: var(--muted); font-size: 12px; }
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------------
   Public / guest pages
   ------------------------------------------------------------------------ */

.guest-body { min-height: 100vh; background: var(--bg); }
.navbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hero { padding: var(--space-10) 0; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.02; max-width: 850px; margin: 14px 0; }
.hero p { max-width: 720px; font-size: 18px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-8); }

/* ------------------------------------------------------------------------
   Authentication
   ------------------------------------------------------------------------ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background:
    radial-gradient(circle at 15% 10%, rgba(59,130,246,.08), transparent 34%),
    radial-gradient(circle at 85% 90%, rgba(124,58,237,.06), transparent 34%),
    var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 36px);
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 24px 0 8px; }
.auth-card form { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
.auth-card label { display: grid; gap: 7px; color: var(--text-strong); font-weight: 650; }
.auth-card a { text-decoration: none; }
.auth-card button[type="submit"], .auth-card .button { width: 100%; min-height: 44px; border: 0; border-radius: var(--radius-md); background: var(--tenant-primary, var(--primary)); color: #fff; font-weight: 750; cursor: pointer; }
.auth-card button[type="submit"]:hover, .auth-card .button:hover { background: var(--primary-hover); transform: translateY(-1px); }
.auth-card a:hover { text-decoration: underline; }
.auth-card #loginMessage,
.auth-card #activationMessage,
.auth-card #forgotMessage { min-height: 20px; margin-top: var(--space-4); }

.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.brand strong { color: var(--text-strong); font-size: 18px; }
.brand span { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------------
   Form controls
   ------------------------------------------------------------------------ */

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: #b8c2d0; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); outline: 0; box-shadow: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .65; }

.auth-card input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar input,
.toolbar select { background: var(--surface); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-grid label { display: grid; gap: 7px; color: var(--text-strong); font-size: 14px; font-weight: 650; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.full { grid-column: 1 / -1; }
.form-message { min-height: 20px; font-size: 13px; }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

/* ------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------ */

.btn, .button, .primary, .secondary, .link, .icon-action, .icon-button, .page-btn {
  border: 0;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn, .button, .primary, .secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary, .primary { background: var(--tenant-primary, var(--primary)); color: #fff; }
.btn-primary:hover, .primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary, .secondary { background: var(--surface-3); color: var(--text-strong); border: 1px solid var(--line); }
.btn-secondary:hover, .secondary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger, .primary.danger { background: var(--danger); color: #fff !important; }
.btn-danger:hover, .primary.danger:hover { background: #9f1f15; }
.btn-sm, .small-btn { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.link { background: transparent; color: var(--primary-2); padding: 6px 8px; font-weight: 650; }
.link:hover { background: var(--info-bg); }
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}
.icon-button:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-action {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}
.icon-action:hover { background: var(--surface-3); color: var(--text-strong); border-color: var(--line); }
.icon-action.positive { color: var(--success); }

