:root {
  color-scheme: dark;
  --bg: #060b16;
  --panel: #0a1222;
  --panel-soft: #0e192c;
  --line: #1a2740;
  --text: #edf2fa;
  --muted: #a9b6cb;
  --quiet: #74839c;
  --accent: #5ea9ff;
  --accent-deep: #1b5fd9;
  --success: #53d5a6;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(53, 207, 255, .08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

button, a { font: inherit; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-card {
  width: min(100%, 430px);
  padding: clamp(28px, 7vw, 46px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 18, 34, .94);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .34);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
}

.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }

.eyebrow {
  margin: 34px 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; letter-spacing: -.025em; }

h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.05; }

.lede {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 11px 18px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button-primary { width: 100%; background: var(--accent-deep); color: #fff; }
.button-primary:hover { background: #2871e0; }

.button-quiet { background: transparent; border-color: var(--line); color: var(--muted); }
.button-quiet:hover { border-color: var(--accent); color: var(--text); }

.privacy-note {
  margin: 17px 0 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.back-link {
  display: block;
  width: max-content;
  margin: 25px auto 0;
  color: var(--muted);
  font-size: 13px;
  text-underline-offset: 4px;
}

.portal-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 22px;
  padding: 15px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 11, 22, .9);
}

.identity { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.identity-name { font-size: 14px; font-weight: 700; }
.identity-meta { color: var(--quiet); font-size: 11px; }
.portal-header form { margin: 0; }

.portal-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 78px 0 100px; }
.portal-intro { max-width: 650px; }
.portal-intro .eyebrow { margin-top: 0; }
.portal-intro > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }

.tool-sections { display: grid; gap: 62px; margin-top: 54px; }

.tool-section { min-width: 0; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 { font-size: clamp(22px, 3vw, 28px); }
.section-heading p { margin: 8px 0 0; color: var(--quiet); font-size: 14px; line-height: 1.5; }
.section-count { flex: 0 0 auto; color: var(--quiet); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-top: 22px;
}

.tool-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--panel-soft), var(--panel));
}

.tool-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 169, 255, .42);
  border-radius: 10px;
  background: rgba(94, 169, 255, .1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

.status { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.tool-card h3 { font-size: 23px; }
.tool-card p { margin: 13px 0 28px; color: var(--muted); line-height: 1.6; }
.tool-link { display: flex; justify-content: space-between; margin-top: auto; color: var(--accent); font-weight: 700; text-decoration: none; }
.tool-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.portal-footer { padding: 22px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; letter-spacing: .14em; text-align: center; }

@media (max-width: 680px) {
  .portal-header { grid-template-columns: 1fr auto; gap: 14px; }
  .identity { grid-column: 1 / -1; grid-row: 2; align-items: flex-start; }
  .portal-header form { grid-column: 2; grid-row: 1; }
  .header-brand span { display: none; }
  .portal-main { width: min(100% - 32px, 1180px); padding-top: 54px; }
  .tool-sections { gap: 48px; margin-top: 44px; }
  .section-heading { align-items: flex-start; }
  .tool-card { min-height: 255px; padding: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
