:root {
  --portal-bg: #0f172a;
  --portal-bg-soft: #12323d;
  --portal-surface: rgba(255, 255, 255, 0.98);
  --portal-surface-strong: #ffffff;
  --portal-text: #0f172a;
  --portal-muted: #5b667a;
  --portal-line: rgba(15, 23, 42, 0.1);
  --portal-primary: #2563eb;
  --portal-primary-strong: #1d4ed8;
  --portal-accent: #14b8a6;
  --portal-warm: #f59e0b;
  --portal-danger: #dc2626;
  --portal-shadow:
    0 24px 60px rgba(8, 17, 32, 0.18), 0 12px 24px rgba(8, 17, 32, 0.1);
  --portal-radius: 28px;
  --portal-radius-lg: 22px;
  --portal-radius-md: 16px;
  --portal-radius-sm: 12px;
  --portal-font:
    "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.portal-body {
  margin: 0;
  font-family: var(--portal-font);
  color: var(--portal-text);
  background: linear-gradient(135deg, #f8fafc 0%, #eef3f8 48%, #e4edf6 100%);
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
}

.portal-visual {
  position: relative;
  overflow: hidden;
  padding: 56px clamp(28px, 5vw, 80px);
  color: #f8fbff;
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, #0f172a 0%, #164e63 58%, #0f3f46 100%);
}

.portal-visual::before,
.portal-visual::after {
  display: none;
}

.portal-visual::before {
  width: 360px;
  height: 360px;
  top: -120px;
  right: -80px;
  background: rgba(37, 99, 235, 0.44);
}

.portal-visual::after {
  width: 280px;
  height: 280px;
  left: -80px;
  bottom: -100px;
  background: rgba(34, 197, 94, 0.22);
}

.portal-visual__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.portal-brand__icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-brand__icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
}

.portal-brand__name {
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 20px;
}

.portal-kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #34d399);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.portal-copy h1,
.portal-copy h2 {
  margin: 0 0 20px;
  color: #ffffff;
  font-size: 2.7rem;
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 700;
}

.portal-copy p {
  margin: 0 0 16px;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  line-height: 1.65;
}

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

.portal-stat {
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.portal-stat strong {
  display: block;
  font-size: 1.35rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 4px;
}

.portal-stat span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.87rem;
  line-height: 1.4;
}

.portal-quote {
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.portal-quote p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.7;
}

.portal-quote__meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.portal-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.portal-card {
  width: 100%;
  max-width: 520px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--portal-shadow);
  padding: clamp(28px, 4vw, 42px);
}

.portal-card--narrow {
  max-width: 470px;
}

.portal-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-primary-strong);
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.16);
}

.portal-card__title {
  margin: 20px 0 12px;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.portal-card__lead {
  margin: 0 0 28px;
  color: var(--portal-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.portal-grid {
  display: grid;
  gap: 14px;
}

.portal-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-field {
  display: grid;
  gap: 8px;
}

.portal-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--portal-text);
  margin-bottom: 6px;
}

.portal-field input,
.portal-field select {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--portal-text);
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.portal-field input:focus,
.portal-field select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.portal-password {
  position: relative;
}

.portal-password button {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--portal-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  cursor: pointer;
}

.portal-btn:hover {
  transform: translateY(-2px);
}

.portal-btn--primary {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--portal-primary),
    var(--portal-primary-strong)
  );
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.24);
}

.portal-btn--ghost {
  color: var(--portal-text);
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.75);
}

.portal-btn--block {
  width: 100%;
}

.portal-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--portal-muted);
  font-size: 0.88rem;
}

.portal-inline a {
  color: var(--portal-primary-strong);
  font-weight: 700;
  text-decoration: none;
}

.portal-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
}

.portal-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.portal-list li::before {
  content: "✓";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--portal-accent);
  font-weight: 900;
}

.portal-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--portal-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.portal-note--support {
  display: grid;
  gap: 6px;
}

.portal-note--support strong {
  color: var(--portal-text);
  font-size: 0.92rem;
}

.portal-note--support a {
  width: fit-content;
  color: var(--portal-primary-strong);
  font-weight: 700;
  text-decoration: none;
}

.portal-flash {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.portal-flash--error {
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.14);
}

.portal-flash--success {
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.14);
}

.portal-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.portal-mini-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.portal-mini-card strong {
  display: block;
  font-size: 1rem;
}

.portal-mini-card span {
  display: block;
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.portal-logo {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  display: block;
}

.portal-logo svg {
  width: 100%;
  height: 100%;
  fill: var(--portal-primary);
}

@media (max-width: 1080px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-visual {
    order: 2;
    min-height: auto;
    padding: 28px 24px 34px;
  }

  .portal-panel {
    order: 1;
    padding-top: 0;
  }

  .portal-stat {
    margin-bottom: 20px;
  }
}

@media (max-width: 720px) {
  body.portal-body {
    background: #f8fafc;
  }

  .portal-visual,
  .portal-panel {
    padding: 14px;
  }

  .portal-panel {
    align-items: flex-start;
    min-height: auto;
  }

  .portal-visual {
    margin-top: 4px;
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .portal-copy h1,
  .portal-copy h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
  }

  .portal-copy p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .portal-quote,
  .portal-stats {
    display: none;
  }

  .portal-stats,
  .portal-grid--two,
  .portal-mini-grid {
    grid-template-columns: 1fr;
  }

  .portal-card {
    padding: 22px 18px;
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  }

  .portal-card__title {
    font-size: 1.7rem;
  }

  .portal-card__lead {
    margin-bottom: 22px;
  }

  .portal-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

.portal-body--login {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #edf3f8 52%, #e4edf6 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.login-header {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 16px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.login-brand {
  background: transparent;
  border: 0;
  color: #0f172a;
  padding: 0;
  backdrop-filter: none;
}

.login-brand .portal-brand__icon {
  width: 44px;
  height: 44px;
}

.login-brand .portal-brand__name {
  color: #0f172a;
  font-size: 1rem;
  letter-spacing: 0.14em;
}

.login-brand__subtitle {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 470px);
  align-items: center;
  justify-content: center;
  padding: 18px 0 26px;
}

.portal-body--login .login-panel {
  padding: 0;
  background: transparent;
}

.portal-body--login .portal-card {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.12);
}

.portal-body--login .portal-note[hidden] {
  display: none;
}

.login-side {
  border-radius: 8px;
  padding: 28px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.12);
}

.login-side__eyebrow {
  width: fit-content;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  color: #99f6e4;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-side h2 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-side p {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.65;
}

.login-status-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-status-list div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-status-list strong,
.login-status-list span {
  display: block;
}

.login-status-list strong {
  color: #ffffff;
  font-size: 0.92rem;
}

.login-status-list span {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.84rem;
  line-height: 1.45;
}

.login-footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 8px 0 28px;
  display: flex;
  justify-content: center;
  color: #64748b;
  font-size: 0.86rem;
  text-align: center;
}

.login-footer a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .login-main {
    grid-template-columns: minmax(320px, 470px);
  }

  .login-side {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-header,
  .login-main,
  .login-footer {
    width: min(100% - 28px, 470px);
  }

  .login-header {
    padding: 18px 0 8px;
  }

  .login-brand {
    margin: 0 auto;
  }

  .login-main {
    padding: 10px 0 16px;
  }

  .portal-body--login .portal-card {
    padding: 20px 18px;
  }

  .portal-body--login .portal-card__title {
    font-size: 1.55rem;
  }

  .portal-body--login .portal-card__lead {
    font-size: 0.92rem;
  }

  .login-footer {
    padding-bottom: 18px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
