:root {
  --navy: #0b2f67;
  --navy-dark: #071d42;
  --accent: #16d7ff;
  --accent-dark: #0498d5;
  --ink: #172033;
  --muted: #6b7280;
  --line: #d9e1ed;
  --panel: #ffffff;
  --page: #f6f7fb;
  --ok: #13795b;
  --danger: #b4234a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--navy-dark);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.portal-header {
  width: min(1120px, calc(100% - 32px));
  height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 58px);
  background: rgba(246, 247, 251, .92);
}

.auth-page .portal-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5;
  width: auto;
  margin: 0;
  background: transparent;
}

.brand {
  color: var(--navy);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  max-width: 176px;
  height: 46px;
  object-fit: contain;
}

.portal-header nav {
  display: flex;
  gap: 18px;
}

.portal-header nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-page .portal-header nav {
  display: none;
}

.portal-main {
  min-height: calc(100vh - 48px);
}

.premium-shell {
  min-height: 100vh;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 23, 58, .35) 0%, rgba(6, 23, 58, .08) 38%, rgba(6, 23, 58, .02) 100%),
    url("banner-rrr.jpg") center/cover no-repeat;
}

.auth-panel {
  width: min(430px, calc(100vw - 42px));
  min-height: 100vh;
  display: flex;
  align-items: center;
  margin-left: clamp(34px, 5vw, 86px);
  padding: 86px 0 26px;
}

.auth-box {
  width: 100%;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(11, 47, 103, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 70px rgba(2, 20, 48, .28);
  backdrop-filter: blur(8px);
}

.signup-visible .auth-box,
.show-signup .auth-box {
  width: min(620px, calc(100vw - 42px));
}

.signup-visible .auth-panel,
.show-signup .auth-panel {
  width: min(620px, calc(100vw - 42px));
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}

.mode-button {
  min-height: 52px;
  border: 0;
  color: #24344d;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.mode-button.active,
.mode-button:hover,
.signup-visible .mode-button[data-mode="signup"],
.show-signup .mode-button[data-mode="signup"] {
  color: #06243f;
  background: linear-gradient(180deg, #4ee8ff, var(--accent-dark));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}

.signup-visible .mode-button[data-mode="login"],
.show-signup .mode-button[data-mode="login"] {
  color: #24344d;
  background: transparent;
  box-shadow: none;
}

.portal-form {
  display: grid;
  gap: 18px;
}

.signup-form {
  display: none;
}

.signup-visible .login-form,
.show-signup .login-form {
  display: none;
}

.signup-visible .signup-form,
.show-signup .signup-form {
  display: grid;
}

.portal-form h1 {
  margin: 0;
  color: #151b29;
  font-size: 30px;
  line-height: 1.15;
}

.form-subtitle {
  margin: -8px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #151b29;
  font-size: 15px;
  font-weight: 800;
}

.field-wrap {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  align-items: center;
  min-height: 54px;
  border: 1px solid #c8d2e1;
  border-radius: 8px;
  background: #fbfcff;
  box-shadow: 0 8px 20px rgba(15, 41, 77, .05);
}

.field-wrap span {
  color: #334b70;
  font-size: 18px;
  text-align: center;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8d2e1;
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcff;
  outline: 0;
}

.field-wrap input {
  min-height: 52px;
  border: 0;
  background: transparent;
}

label > input,
textarea {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
.field-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 215, 255, .22);
}

.password-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #334b70;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent-dark);
  background: rgba(22, 215, 255, .12);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
}

.password-toggle .eye-closed,
.password-toggle.show-password .eye-open {
  display: none;
}

.password-toggle.show-password .eye-closed {
  display: block;
}

.simple-password {
  grid-template-columns: 1fr 44px;
}

.simple-password input {
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0 12px;
}

.signup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.signup-grid .full {
  grid-column: 1 / -1;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #24dcff, var(--accent-dark));
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(4, 152, 213, .28);
}

.primary-button:hover {
  filter: brightness(.97);
}

.switch-line {
  margin: 0;
  padding-top: 8px;
  color: #303847;
  font-size: 15px;
  text-align: center;
}

.switch-line button {
  border: 0;
  color: var(--navy);
  background: transparent;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

.alert {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.alert.success {
  color: var(--ok);
  background: #ecfdf3;
}

.alert.error {
  color: var(--danger);
  background: #fff0f4;
}

.visual-panel {
  display: none;
}

.portal-footer {
  display: none;
}

.dashboard-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(22, 215, 255, .16), transparent 28%),
    linear-gradient(180deg, #f5f9fc, #eef4f8);
}

.dashboard-page .portal-header {
  width: min(1320px, calc(100% - 36px));
  margin-top: 18px;
  border: 1px solid rgba(200, 210, 225, .75);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 18px 45px rgba(15, 41, 77, .08);
  backdrop-filter: blur(12px);
}

.dashboard-page .portal-main {
  width: min(1320px, calc(100% - 36px));
  min-height: auto;
  margin: 18px auto 48px;
}

.dashboard-page .portal-footer {
  display: block;
  color: var(--muted);
  text-align: center;
  padding: 0 0 28px;
}

.hero.compact {
  min-height: 190px;
  display: flex;
  align-items: center;
  padding: clamp(28px, 5vw, 54px);
  color: #fff;
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  border-radius: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1,
.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
}

.hero p:last-child {
  max-width: 620px;
  margin: 12px 0 0;
  font-size: 17px;
}

.panel,
.resource-card,
.partner-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(15, 41, 77, .08);
}

.panel {
  padding: 28px;
}

.panel.narrow {
  width: min(460px, 100%);
  margin: 36px auto;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.resource-card {
  position: relative;
  min-height: 220px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.resource-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 215, 255, .18), transparent 65%);
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 46px rgba(15, 41, 77, .13);
}

.resource-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent-dark);
  background: #e9fbff;
}

.resource-icon svg {
  width: 28px;
  height: 28px;
}

.resource-card span,
.status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.resource-card h2 {
  margin: 12px 0 0;
  font-size: 22px;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 9px;
  padding: 0 18px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #123d81, var(--navy));
  font-weight: 800;
  text-decoration: none;
  justify-self: start;
  box-shadow: 0 12px 24px rgba(11, 47, 103, .18);
}

.download svg {
  width: 18px;
  height: 18px;
}

.dashboard-hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 28px;
  padding: clamp(34px, 5vw, 68px);
  color: #fff;
  background:
    linear-gradient(115deg, rgba(7, 29, 66, .96), rgba(11, 47, 103, .86)),
    url("banner-rrr.jpg") center/cover no-repeat;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 24px 60px rgba(7, 29, 66, .22);
}

.dashboard-hero p:last-child {
  max-width: 700px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: 20px;
}

.hero-stats {
  min-width: 170px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  text-align: center;
}

.hero-stats strong {
  display: block;
  color: var(--accent);
  font-size: 48px;
  line-height: 1;
}

.hero-stats span {
  color: rgba(255, 255, 255, .82);
  font-weight: 800;
}

.admin-list {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.partner-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 20px;
}

.partner-row h2 {
  margin: 0 0 8px;
}

.partner-row p {
  margin: 7px 0;
  color: var(--muted);
}

.status-block {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 10px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .auth-page .portal-header {
    position: static;
    width: 100%;
    background: rgba(246, 247, 251, .92);
  }

  .premium-shell {
    min-height: auto;
    overflow: visible;
    background-position: 58% center;
  }

  .auth-panel {
    min-height: calc(100vh - 74px);
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 24px 0;
  }
}

@media (max-width: 620px) {
  .premium-shell {
    background:
      linear-gradient(rgba(6, 23, 58, .52), rgba(6, 23, 58, .52)),
      url("banner-rrr.jpg") 42% center/cover no-repeat;
  }

  .auth-box {
    padding: 20px;
  }

  .signup-grid,
  .resource-list,
  .partner-row {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .visual-copy h2 {
    font-size: 34px;
  }

  .status-block {
    justify-items: start;
  }
}
