:root {
  color-scheme: light;
  --ink: #2f4b67;
  --ink-deep: #29445f;
  --title-soft: #6b8ba5;
  --muted: #73869a;
  --line: #ccd7e1;
  --icon: #8497aa;
  --surface: rgba(255, 255, 255, 0.96);
  --focus: #638aaa;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--ink-deep);
  background: #eef4f8;
}

button,
input {
  font: inherit;
}

.login-page {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(132px, calc(11vh + 60px), 180px) 20px clamp(28px, 4vh, 44px);
  overflow-x: hidden;
  background-color: #f6f8fa;
  background-image: url("./Фон страницы входа.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.logo-positioner {
  position: absolute;
  top: 44px;
  right: 48px;
  z-index: 1;
  width: min(20.5vw, 390px);
  height: 100px;
  pointer-events: none;
}

.brand-logo {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  user-select: none;
  transform: translate(21.3%, -23%);
}

.content {
  width: min(100%, 560px);
  margin: 0 auto;
  text-align: center;
}

.portal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  color: var(--title-soft);
  font-size: clamp(31px, 2.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.35px;
}

.subtitle {
  margin-bottom: 38px;
  color: var(--muted);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 400;
  line-height: 1.35;
}

.login-card {
  width: min(100%, 560px);
  padding: 31px 44px 30px;
  text-align: left;
  border: 1px solid rgba(188, 202, 214, 0.58);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 21px 48px rgba(48, 73, 96, 0.16);
}

.icon {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 28px;
}

.card-title-row h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.15;
}

.icon-shield-lock {
  width: 45px;
  height: 51px;
  color: #6f89a1;
}

.form-group {
  margin-bottom: 22px;
}

label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 650;
}

.input-shell {
  position: relative;
}

input {
  width: 100%;
  height: 54px;
  padding: 0 52px 0 55px;
  color: var(--ink-deep);
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(250, 252, 254, 0.88);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input::placeholder {
  color: #9ba9b6;
}

input:hover {
  border-color: #aebdca;
}

input:focus-visible {
  border-color: var(--focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 138, 170, 0.15);
}

.input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 18px;
  width: 21px;
  height: 21px;
  color: var(--icon);
  transform: translateY(-50%);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--icon);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: rgba(99, 125, 150, 0.08);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
}

.eye-icon {
  width: 23px;
  height: 23px;
}

.eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: inline;
}

.login-button {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 64px;
  margin-top: 29px;
  padding: 0 25px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: 0;
  border-radius: 11px;
  background: #2f4c68;
  box-shadow: 0 8px 17px rgba(42, 71, 96, 0.17);
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.login-button span:first-child {
  grid-column: 2;
}

.login-button:hover {
  background: #385873;
  box-shadow: 0 10px 22px rgba(42, 71, 96, 0.24);
}

.login-button:active {
  background: #263f58;
  box-shadow: 0 4px 11px rgba(42, 71, 96, 0.2);
}

.login-button:focus-visible {
  outline: 3px solid rgba(99, 138, 170, 0.4);
  outline-offset: 3px;
}

.arrow-icon {
  grid-column: 3;
  justify-self: end;
  width: 26px;
  height: 26px;
  stroke-width: 1.9;
}

.login-message {
  max-height: 0;
  margin: 0;
  padding: 0 12px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  border: 0 solid #cfdae4;
  border-radius: 8px;
  opacity: 0;
  background: #f1f6fa;
  transition: max-height 180ms ease, margin 180ms ease, padding 180ms ease, opacity 180ms ease;
}

.login-message.is-visible {
  max-height: 72px;
  margin-top: 13px;
  padding: 9px 12px;
  border-width: 1px;
  opacity: 1;
}

@media (max-width: 1100px) {
  .logo-positioner {
    right: 32px;
    width: 205px;
  }
}

@media (max-width: 899px) {
  .login-page {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 22px 18px 36px;
  }

  .logo-positioner {
    position: relative;
    top: auto;
    right: auto;
    width: clamp(240px, 39vw, 300px);
    height: clamp(57px, 9.3vw, 72px);
    margin: 0 auto 18px;
  }

  .brand-logo {
    top: 0;
    right: auto;
    left: 50%;
    transform: translate(-50%, -23%);
  }

  .subtitle {
    margin-bottom: 28px;
  }

  .login-card {
    padding: 27px 28px 26px;
  }
}

@media (max-width: 460px) {
  .login-page {
    padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
  }

  .logo-positioner {
    width: clamp(240px, 70vw, 280px);
    height: clamp(57px, 16.7vw, 67px);
    margin-bottom: 14px;
  }

  h1 {
    margin-bottom: 6px;
    font-size: clamp(27px, 8.1vw, 31px);
  }

  .subtitle {
    max-width: 292px;
    margin-bottom: 22px;
    font-size: 16px;
  }

  .login-card {
    padding: 23px 18px 22px;
    border-radius: 16px;
  }

  .card-title-row {
    gap: 13px;
    margin-bottom: 22px;
  }

  .icon-shield-lock {
    width: 39px;
    height: 45px;
  }

  .card-title-row h2 {
    font-size: clamp(21px, 6.4vw, 24px);
  }

  .form-group {
    margin-bottom: 18px;
  }

  label {
    margin-bottom: 7px;
  }

  input {
    height: 52px;
    padding-left: 51px;
    font-size: 16px;
  }

  .input-icon {
    left: 16px;
  }

  .login-button {
    min-height: 56px;
    margin-top: 21px;
    padding-inline: 20px;
  }
}

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

  .logo-positioner {
    width: 230px;
    height: 55px;
    margin-bottom: 12px;
  }

  .login-card {
    padding-inline: 16px;
  }

  .card-title-row {
    gap: 10px;
  }

  .card-title-row h2 {
    font-size: 21px;
  }
}

@media (max-height: 820px) and (min-width: 900px) {
  .login-page {
    padding-top: 116px;
    padding-bottom: 24px;
  }

  .content,
  .login-card {
    max-width: 520px;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    margin-bottom: 36px;
    font-size: 19px;
  }

  .login-card {
    padding: 23px 40px 22px;
  }

  .card-title-row {
    margin-bottom: 19px;
  }

  .icon-shield-lock {
    width: 40px;
    height: 46px;
  }

  .card-title-row h2 {
    font-size: 26px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  input {
    height: 50px;
  }

  .login-button {
    min-height: 55px;
    margin-top: 21px;
  }
}

@media (max-height: 500px) and (max-width: 899px) {
  .login-page {
    padding-top: 14px;
  }

  .logo-positioner {
    width: 220px;
    height: 52px;
    margin-bottom: 10px;
  }

  .subtitle {
    margin-bottom: 18px;
  }
}

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

.dashboard-root {
  min-width: 0;
  overflow-x: hidden;
}

.dashboard-body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #f2f7fb;
  color: #223249;
}

.dashboard-page {
  display: grid;
  min-height: 100vh;
  padding: clamp(20px, 5vw, 64px);
  place-items: center;
}

.dashboard-card {
  width: min(100%, 620px);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(41, 83, 126, 0.14);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(31, 65, 99, 0.14);
}

.dashboard-logo {
  display: block;
  width: min(210px, 60vw);
  height: auto;
  margin: 0 auto 28px;
}

.dashboard-kicker {
  margin: 0 0 8px;
  color: #006cae;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-card h1 {
  margin: 0 0 32px;
  font-size: clamp(28px, 5vw, 40px);
  text-align: center;
}

.dashboard-user {
  display: grid;
  gap: 14px;
  margin: 0 0 28px;
}

.dashboard-user div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid #e5edf4;
}

.dashboard-user dt {
  color: #64768a;
}

.dashboard-user dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.dashboard-logout {
  width: 100%;
}

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

  .dashboard-card {
    padding-inline: 20px;
    border-radius: 18px;
  }

  .dashboard-user div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
