:root {
  --blue: #117cc2;
  --blue-2: #1689d8;
  --blue-3: #4aa9e8;
  --navy: #0e3557;
  --navy-2: #09243c;
  --text: #071827;
  --muted: #64748b;
  --background: #f4f8fc;
  --line: #dbe7f1;
  --danger: #b42318;
  --danger-background: #fff4f2;
  --danger-line: #fecdca;
  --shadow: 0 30px 90px rgba(9, 36, 60, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(74, 169, 232, 0.24), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(17, 124, 194, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbfe 0%, var(--background) 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-shell {
  width: min(980px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1.08fr);
  overflow: hidden;
  border: 1px solid rgba(219, 231, 241, 0.92);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 5vw, 58px);
  color: #fff;
  background: linear-gradient(145deg, var(--navy-2), var(--navy));
}

.login-intro::before,
.login-intro::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.login-intro::before {
  top: -110px;
  right: -120px;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(17, 124, 194, 0.78), rgba(17, 124, 194, 0));
}

.login-intro::after {
  bottom: -150px;
  left: -150px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(74, 169, 232, 0.25), rgba(74, 169, 232, 0));
}

.intro-content,
.intro-mark {
  position: relative;
  z-index: 1;
}

.intro-eyebrow,
.login-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro-eyebrow {
  color: #86d0ff;
}

.intro-content h2 {
  max-width: 430px;
  margin: 14px 0 18px;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.intro-content p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.65;
}

.intro-mark {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.intro-mark i {
  color: #86d0ff;
  font-size: 24px;
}

.login-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 64px);
}

.login-header {
  margin-bottom: 30px;
}

.login-logo {
  width: 176px;
  max-width: 64%;
  height: auto;
  display: block;
  margin-bottom: 34px;
}

.login-eyebrow {
  color: var(--blue);
}

.login-header h1 {
  margin: 7px 0 9px;
  color: var(--text);
  font-size: clamp(29px, 3.2vw, 39px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

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

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.input-wrap {
  position: relative;
  min-width: 0;
}

.input-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 13px 48px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-wrap input::placeholder {
  color: #91a1b1;
}

.input-wrap input:hover {
  border-color: #bed2e3;
}

.input-wrap input:focus {
  border-color: rgba(17, 124, 194, 0.62);
  box-shadow: 0 0 0 4px rgba(17, 124, 194, 0.1);
}

.input-wrap input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.field-icon,
.password-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.field-icon {
  left: 15px;
  color: #7890a5;
  font-size: 20px;
  pointer-events: none;
}

.password-toggle {
  right: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
}

.password-toggle:hover {
  color: var(--blue);
  background: #eef7ff;
}

.password-toggle:focus-visible,
.login-submit:focus-visible {
  outline: 3px solid rgba(17, 124, 194, 0.28);
  outline-offset: 3px;
}

.login-message {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  visibility: hidden;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.login-message.is-visible {
  visibility: visible;
  border-color: var(--danger-line);
  background: var(--danger-background);
}

.login-message::before {
  margin-right: 8px;
  content: "\F0026";
  font: normal normal normal 19px/1 "Material Design Icons";
}

.login-message:not(.is-visible)::before {
  display: none;
}

.login-submit {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 12px 26px rgba(17, 124, 194, 0.24);
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.login-submit:hover:not(:disabled) {
  box-shadow: 0 16px 32px rgba(17, 124, 194, 0.3);
  transform: translateY(-1px);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-loading {
  display: none;
  align-items: center;
  gap: 9px;
}

.login-submit.is-loading .button-label {
  display: none;
}

.login-submit.is-loading .button-loading {
  display: inline-flex;
}

.button-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.login-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 11px;
}

.login-footer strong {
  color: var(--navy);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 780px) {
  .login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }

  .login-shell {
    width: calc(100vw - 36px);
    max-width: 520px;
    min-height: auto;
    grid-template-columns: 1fr;
    border-radius: 28px;
  }

  .login-intro {
    display: none;
  }

  .login-panel {
    min-height: min(650px, calc(100vh - 36px));
    padding: clamp(28px, 8vw, 48px);
  }
}

@media (max-width: 420px) {
  .login-page {
    align-items: start;
    padding: 10px;
  }

  .login-shell {
    width: calc(100vw - 20px);
    border-radius: 24px;
  }

  .login-panel {
    min-height: calc(100vh - 20px);
    padding: 28px 20px;
  }

  .login-logo {
    width: 150px;
    margin-bottom: 28px;
  }

  .login-header {
    margin-bottom: 24px;
  }
}

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