:root {
  --bg: #071225;
  --panel: #111f3d;
  --panel-soft: #17284d;
  --border: rgba(131, 159, 255, 0.27);
  --text: #f2f6ff;
  --muted: #adc0eb;
  --accent: #5b6cff;
  --accent-2: #26c1f3;
  --ok: #33cf99;
  --warn: #f2b450;
  --danger: #ee6487;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1a2c52 0%, #09142d 46%, #071225 100%);
  color: var(--text);
}

a {
  color: #8acbff;
}

body[data-page="login"],
body[data-page="register"] {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(43, 167, 247, 0.28) 0%, rgba(43, 167, 247, 0) 34%),
    radial-gradient(circle at bottom right, rgba(17, 68, 118, 0.24) 0%, rgba(17, 68, 118, 0) 30%),
    linear-gradient(180deg, #0e1117 0%, #08111d 52%, #050b14 100%);
}

body[data-page="login"]::before,
body[data-page="register"]::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 138px;
  background: linear-gradient(90deg, #1999e5 0%, #1b90d7 55%, #0d6ea9 100%);
  z-index: 0;
}

body[data-page="login"]::after,
body[data-page="register"]::after {
  content: "";
  position: fixed;
  inset: auto -160px -180px auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 150, 230, 0.22) 0%, rgba(24, 150, 230, 0) 70%);
  pointer-events: none;
}

.portal-shell.auth-shell {
  position: relative;
  z-index: 1;
  display: block;
  width: min(1220px, 100%);
  padding: 1.3rem clamp(1rem, 2.8vw, 2rem) 2rem;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #ffffff;
}

.site-brand-copy {
  display: grid;
  gap: 0.08rem;
}

.site-brand-copy strong {
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.site-brand-copy small {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.84);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 30px rgba(6, 18, 39, 0.22);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: #ffffff;
}

.brand-mark::before {
  width: 22px;
  height: 6px;
  top: 14px;
  left: 13px;
  box-shadow:
    -8px 8px 0 -1px rgba(255, 255, 255, 0.92),
    8px 8px 0 -1px rgba(255, 255, 255, 0.92);
}

.brand-mark::after {
  width: 6px;
  height: 22px;
  top: 13px;
  left: 21px;
}

.auth-topbar-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.topbar-link {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.4rem 0.25rem;
}

.topbar-link:hover {
  color: #ffffff;
}

.topbar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.76rem 1.3rem;
  border-radius: 999px;
  background: #ffffff;
  color: #1185cf;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(9, 22, 43, 0.16);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 470px);
  gap: 1.2rem;
  align-items: stretch;
}

.auth-hero,
.auth-panel {
  border-radius: 28px;
  border: 1px solid rgba(86, 142, 215, 0.24);
  box-shadow: 0 24px 56px rgba(4, 11, 22, 0.34);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 610px;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background:
    radial-gradient(circle at top right, rgba(31, 135, 215, 0.26) 0%, rgba(31, 135, 215, 0) 32%),
    linear-gradient(155deg, rgba(10, 19, 33, 0.9) 0%, rgba(7, 13, 23, 0.96) 58%, rgba(6, 11, 19, 0.98) 100%);
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(23, 153, 229, 0.1) 0%, rgba(23, 153, 229, 0) 36%),
    linear-gradient(0deg, rgba(3, 7, 12, 0.06), rgba(3, 7, 12, 0.06));
  pointer-events: none;
}

.auth-hero > * {
  position: relative;
  z-index: 1;
}

.auth-eyebrow,
.auth-mini-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 171, 235, 0.32);
  background: rgba(18, 110, 167, 0.12);
  color: #bde7ff;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.03;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.auth-hero p {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: #d4e6fb;
  font-size: 1rem;
  line-height: 1.72;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 1.45rem 0 0;
  display: grid;
  gap: 0.8rem;
}

.hero-points li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.86rem 1rem;
  border-radius: 18px;
  background: rgba(11, 20, 35, 0.72);
  border: 1px solid rgba(77, 142, 204, 0.2);
  color: #eff7ff;
  line-height: 1.55;
}

.hero-points li::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.45rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #35bcff 0%, #0f7fca 100%);
  box-shadow: 0 0 0 6px rgba(32, 146, 223, 0.12);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  background: rgba(15, 127, 199, 0.16);
  border: 1px solid rgba(88, 162, 224, 0.24);
  color: #e7f5ff;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-chip--dark {
  background: rgba(255, 255, 255, 0.08);
}

.auth-panel {
  padding: clamp(1.2rem, 2vw, 1.5rem);
  background: linear-gradient(180deg, rgba(13, 24, 40, 0.96) 0%, rgba(9, 16, 29, 0.98) 100%);
}

.auth-panel .auth-card {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: clamp(0.4rem, 1vw, 0.7rem);
}

.auth-panel h2 {
  margin-top: 0.9rem;
  font-size: 1.9rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.auth-panel .muted {
  color: #a9c1df;
}

.auth-shell .auth-form {
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-shell label {
  gap: 0.42rem;
  font-size: 0.82rem;
  color: #cfe1f8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-shell input,
.auth-shell select,
.auth-shell textarea {
  min-height: 52px;
  color: #f3f8ff;
  background: rgba(5, 12, 23, 0.9);
  border: 1px solid rgba(82, 145, 207, 0.34);
  border-radius: 16px;
  padding: 0.82rem 0.95rem;
}

.auth-shell input:focus,
.auth-shell select:focus,
.auth-shell textarea:focus {
  border-color: rgba(78, 185, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(33, 146, 223, 0.16);
}

.auth-shell button.primary {
  min-height: 54px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a9be8 0%, #1179be 100%);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 118, 184, 0.28);
}

.invite-meta {
  margin-top: 0.95rem;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: rgba(8, 18, 33, 0.8);
  border: 1px solid rgba(80, 141, 204, 0.22);
}

.auth-shell .status-box {
  margin-top: 0.95rem;
  min-height: 50px;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(76, 142, 205, 0.22);
  background: rgba(8, 18, 33, 0.82);
}

.auth-shell .status-box.error {
  border-color: rgba(232, 109, 144, 0.46);
  background: rgba(106, 22, 46, 0.46);
}

.auth-shell .status-box.success {
  border-color: rgba(94, 221, 170, 0.48);
  background: rgba(14, 95, 66, 0.46);
}

.auth-shell .helper-links {
  margin-top: 1.05rem;
  display: grid;
  gap: 0.72rem;
}

.auth-shell .helper-links a {
  width: fit-content;
  color: #9fdcff;
  text-decoration: none;
}

.auth-shell .helper-links a:hover {
  color: #d9f3ff;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(18, 33, 65, 0.94) 0%, rgba(14, 25, 49, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
}

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

.auth-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

label {
  display: grid;
  gap: 0.34rem;
  font-size: 0.83rem;
  color: var(--muted);
}

input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: rgba(11, 19, 38, 0.9);
  border: 1px solid rgba(134, 167, 255, 0.35);
  border-radius: 10px;
  padding: 0.54rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(126, 161, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(90, 127, 255, 0.2);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.56rem 0.8rem;
  font-weight: 600;
}

button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}

button.secondary {
  background: rgba(44, 67, 120, 0.6);
  border-color: rgba(140, 165, 255, 0.35);
  color: #fff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-box {
  margin-top: 0.75rem;
  padding: 0.64rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 161, 255, 0.3);
  background: rgba(21, 35, 69, 0.62);
  min-height: 44px;
  font-size: 0.84rem;
}

.status-box.error {
  border-color: rgba(240, 116, 150, 0.5);
  background: rgba(133, 40, 72, 0.42);
}

.status-box.success {
  border-color: rgba(106, 232, 178, 0.54);
  background: rgba(21, 109, 78, 0.42);
}

.helper-links {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.portal-app {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  width: min(1180px, 100%);
}

.portal-header,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 33, 65, 0.92) 0%, rgba(14, 25, 49, 0.95) 100%);
  border-radius: 14px;
  padding: 0.84rem;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ghost-link {
  text-decoration: none;
  border: 1px solid rgba(132, 159, 255, 0.42);
  border-radius: 999px;
  padding: 0.29rem 0.56rem;
  color: #d7e7ff;
}

.kv-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kv {
  border: 1px solid rgba(120, 154, 245, 0.25);
  border-radius: 10px;
  padding: 0.56rem;
  background: rgba(26, 42, 82, 0.45);
}

.kv .label {
  color: var(--muted);
  font-size: 0.78rem;
}

.kv .value {
  font-weight: 650;
  margin-top: 0.18rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead th {
  text-align: left;
  font-size: 0.76rem;
  color: #c9dafd;
  border-bottom: 1px solid rgba(133, 160, 234, 0.24);
  padding: 0.5rem 0.38rem;
}

tbody td {
  border-bottom: 1px solid rgba(89, 115, 187, 0.2);
  padding: 0.47rem 0.38rem;
  font-size: 0.83rem;
}

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  border: 1px solid rgba(131, 158, 238, 0.37);
  background: rgba(42, 66, 120, 0.46);
  font-size: 0.72rem;
}

.badge.alert {
  border-color: rgba(244, 122, 157, 0.57);
  background: rgba(146, 47, 83, 0.42);
  color: #ffd2df;
}

.badge.ok {
  border-color: rgba(112, 231, 182, 0.58);
  background: rgba(21, 113, 82, 0.42);
  color: #ceffee;
}

.activity {
  display: grid;
  gap: 0.3rem;
  min-width: 170px;
}

.activity .meter {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(55, 83, 140, 0.42);
  overflow: hidden;
}

.activity .fill {
  height: 100%;
}

.fill.none { background: #7786aa; }
.fill.low { background: #35d49a; }
.fill.medium { background: #f2b450; }
.fill.high { background: #ee6487; }

@media (max-width: 760px) {
  .auth-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-topbar-links {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: auto;
  }

  .auth-hero h1 {
    max-width: none;
  }

  .auth-card {
    padding: 0.85rem;
  }
}
