/* AscendIT portal — committed dark identity.
   Ground: blue-biased near-black. Accent: aged gold ("summit light").
   Display: Bricolage Grotesque · UI: Instrument Sans · Data: Spline Sans Mono */

:root {
  --ink: #0a0e16;
  --surface: #111725;
  --surface-2: #171f30;
  --line: #222c40;
  --line-soft: #1a2334;
  --text: #e8ecf4;
  --muted: #97a1b7;
  --faint: #5c6780;
  --accent: #d9a441;
  --accent-soft: rgba(217, 164, 65, 0.14);
  --accent-line: rgba(217, 164, 65, 0.38);
  --ok: #4cc38a;
  --err: #e5484d;
  --warn: #e8793a;
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", Consolas, monospace;
}

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

body {
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(217, 164, 65, 0.07), transparent 60%),
    radial-gradient(1100px 700px at 12% 110%, rgba(59, 92, 176, 0.10), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- wordmark */
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--text);
  text-wrap: balance;
}
.wordmark span { color: var(--accent); }
.wordmark.small { font-size: 1.2rem; text-align: left; }

.tagline {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1.6rem;
}

/* ---------------------------------------------------------------- auth card */
.center-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 1.2rem;
}

.auth-card {
  width: 100%;
  max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 2.4rem 2.1rem 2.1rem;
  box-shadow: 0 24px 70px rgba(2, 4, 10, 0.6);
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 1rem 0 0.35rem;
}

input[type="text"], input[type="password"] {
  width: 100%;
  background: var(--ink);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  margin-top: 1.4rem;
  width: 100%;
  background: var(--accent);
  color: #14100a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.72rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.12s ease;
}
button:hover { filter: brightness(1.08); }

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: auto;
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.83rem;
}
button.ghost:hover { color: var(--text); background: var(--surface-2); filter: none; }

button.small-btn {
  width: auto;
  margin: 0;
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
button.small-btn:hover { background: var(--line-soft); filter: none; }
button.small-btn.danger { color: var(--err); border-color: rgba(229, 72, 77, 0.35); }
button.small-btn.danger:hover { background: rgba(229, 72, 77, 0.1); }

/* ---------------------------------------------------------------- alerts */
.alert {
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border: 1px solid;
  overflow-wrap: anywhere;
}
.alert.err  { background: rgba(229, 72, 77, 0.10); border-color: rgba(229, 72, 77, 0.4);  color: #ff9a9e; }
.alert.ok   { background: rgba(76, 195, 138, 0.09); border-color: rgba(76, 195, 138, 0.35); color: #7fdcae; }
.alert.warn { background: rgba(232, 121, 58, 0.10); border-color: rgba(232, 121, 58, 0.4);  color: #f0a274; }

/* Temp passwords etc. render in mono inside flashes */
.alert code, .mono { font-family: var(--font-mono); font-size: 0.86em; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.6rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 14, 22, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar nav { display: flex; align-items: center; gap: 1.2rem; }
.topbar nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.page { max-width: 880px; margin: 0 auto; padding: 2.2rem 1.3rem 4.5rem; }
.page.wide { max-width: 1020px; }

.page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.005em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.inline-form { display: inline; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
footer.tiny { color: var(--faint); }

/* ---------------------------------------------------------------- app tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.3rem;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem 1.3rem;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  text-decoration: none;
}
.tile-icon { font-size: 1.9rem; }
.tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  margin-top: 0.7rem;
  color: var(--text);
}
.tile-desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------------------------------------------------------------- panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
}
.panel.disabled { opacity: 0.55; }

.row-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
}
.row-form > div { flex: 1 1 150px; }
.row-form label { margin-top: 0; }
.row-form button { width: auto; margin: 0; padding: 0.62rem 1.4rem; flex: 0 0 auto; }
.row-form .check { flex: 0 0 auto; padding-bottom: 0.62rem; }
.row-form .check label {
  color: var(--text);
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
input[type="checkbox"] { accent-color: var(--accent); }

.user-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.user-head .name { font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem; }
.user-head .meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); }

.badge {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.16rem 0.58rem;
  margin-left: 0.45rem;
  vertical-align: middle;
}
.badge.err  { background: rgba(229, 72, 77, 0.14);  color: var(--err); }
.badge.warn { background: rgba(232, 121, 58, 0.14); color: var(--warn); }

/* ------------------------------------------------- app + page grant blocks */
.grant-block {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.75rem 0.9rem;
  margin-top: 0.7rem;
}
.grant-head { display: flex; align-items: center; gap: 0.5rem; }
.grant-head label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.page-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.check-pill:hover { border-color: var(--accent-line); color: var(--text); }
.check-pill:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}
.grant-hint { font-size: 0.72rem; color: var(--faint); margin-top: 0.55rem; }

.actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }

/* page rows on the apps admin */
.page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-top: 1px solid var(--line-soft);
  padding: 0.5rem 0;
  font-size: 0.85rem;
}
.page-row .prefixes { font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover { transform: none; }
}
