:root {
  color-scheme: light;
  --ink: #1b1b1b;
  --muted: #616161;
  --line: #d7d7d7;
  --line-strong: #b9b9b9;
  --field: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --accent: #161616;
  --accent-hover: #000000;
  --focus: rgba(0, 0, 0, 0.16);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0.74)),
    linear-gradient(135deg, #f7f8f8 0%, #eceff1 52%, #d5dadd 100%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.login-page {
  --line: #d9d9d9;
  --line-strong: #161616;
  --field: transparent;
  --panel: transparent;
  --focus: rgba(0, 0, 0, 0.08);
  --shadow: none;
  background: #ffffff;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
}

.login-panel {
  width: min(100%, 280px);
  padding: 0;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 14px;
}

.error-message {
  margin: 0 0 18px;
  padding: 0;
  color: #1f1f1f;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.login-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--field);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  font-size: 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-form input::placeholder {
  color: #8b8b8b;
}

.login-form input:focus {
  border-bottom-color: var(--line-strong);
  box-shadow: 0 7px 0 -6px var(--focus);
}

.login-form button {
  display: grid;
  width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 8px auto 0;
  padding: 0;
  place-items: center;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 140ms ease, transform 140ms ease;
}

.login-form button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 520px) {
  .page {
    padding: 18px;
    align-items: start;
    padding-top: 12svh;
  }

  .login-panel {
    width: min(100%, 260px);
  }
}

.login-form button:hover {
  color: var(--accent-hover);
  transform: translateX(2px);
}

.login-form button:active {
  transform: translateX(4px);
}

.portal-page {
  min-height: 100svh;
  padding: 24px;
}

.portal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(22px);
}

.portal-brand,
.portal-nav,
.portal-logout {
  display: inline-flex;
  align-items: center;
}

.portal-brand {
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.portal-brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.portal-nav {
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.portal-nav a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  color: #555555;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.portal-nav a[aria-current="page"],
.portal-nav a:hover {
  color: #111111;
  background: #ffffff;
}

.portal-logout {
  justify-self: end;
  min-height: 34px;
  padding: 0 13px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.portal-logout:hover {
  background: var(--accent-hover);
}

.portal-main {
  width: min(100%, 1120px);
  margin: 22px auto 0;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 34px;
  align-items: end;
  min-height: 330px;
  padding: 44px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, rgba(22, 22, 22, 0.08), rgba(22, 22, 22, 0));
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.portal-kicker {
  margin: 0 0 12px;
  color: #5e5e5e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.portal-hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: 0;
}

.portal-hero p:not(.portal-kicker) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.portal-user {
  display: grid;
  gap: 9px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
}

.portal-user span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.portal-user strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.portal-user a {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  margin-top: 8px;
  padding: 0 11px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.portal-user a:hover {
  background: var(--accent-hover);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.portal-card {
  display: flex;
  min-height: 214px;
  flex-direction: column;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(18px);
}

.portal-card-primary {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0));
  border-color: rgba(0, 0, 0, 0.08);
}

.card-index {
  display: inline-flex;
  margin-bottom: 42px;
  color: #6c6c6c;
  font-size: 12px;
  font-weight: 700;
}

.portal-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0;
}

.portal-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.portal-card-link {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  margin-top: auto;
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.portal-card-link:hover {
  background: var(--accent-hover);
}

.portal-card-status {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  margin-top: auto;
  padding: 0 10px;
  color: #4e4e4e;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
}

.portal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
}

.portal-strip div {
  display: grid;
  gap: 5px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.78);
}

.portal-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.portal-strip strong {
  font-size: 15px;
}

@media (max-width: 480px) {
  .page {
    align-items: center;
    padding: 16px;
  }

  .login-panel {
    width: 100%;
    max-width: 350px;
    padding: 0;
  }
}

@media (max-width: 820px) {
  .portal-page {
    padding: 14px;
  }

  .portal-header {
    grid-template-columns: 1fr auto;
  }

  .portal-nav {
    grid-column: 1 / -1;
    justify-content: stretch;
    order: 3;
    width: 100%;
  }

  .portal-nav a {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .portal-hero {
    grid-template-columns: 1fr;
    padding: 28px 22px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-strip {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 150px;
  }

  .card-index {
    margin-bottom: 28px;
  }
}

@media (max-width: 420px) {
  .portal-brand {
    font-size: 14px;
  }

  .portal-logout {
    padding: 0 10px;
  }

  .portal-hero h1 {
    font-size: 31px;
  }
}

@media (max-width: 360px) {
  .page {
    padding: 12px;
  }

  .login-panel {
    padding: 0;
  }
}
