:root {
  --navy-950: #071c33;
  --navy-800: #12375a;
  --blue-700: #175ea8;
  --blue-600: #2474c7;
  --blue-100: #eaf4ff;
  --green-100: #e7f7ef;
  --green-700: #24725b;
  --ink: #13283e;
  --muted: #5c7185;
  --line: #d7e3ee;
  --danger: #b4233b;
  --danger-bg: #fff1f3;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background: #f7fafc;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #f1bc3d;
  outline-offset: 3px;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  background: #fff;
}

.login-panel {
  min-width: 0;
}

.login-intro {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 58px);
  color: #fff;
  background:
    radial-gradient(circle at 86% 12%, rgba(84, 160, 228, 0.28), transparent 29%),
    linear-gradient(145deg, #08233e 0%, #123f66 100%);
}

.login-intro::before {
  position: absolute;
  width: 350px;
  height: 350px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
  inset-block-start: -210px;
  inset-inline-end: -135px;
}

.intro-header,
.mobile-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  object-fit: cover;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.mobile-header .brand {
  color: #07345a;
}

.language-switch {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #b8cadb;
  border-radius: 11px;
  color: var(--navy-800);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 750;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.language-switch:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
  background: var(--blue-100);
}

.language-switch-light {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.language-switch-light:hover {
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.language-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
}

.intro-content {
  position: relative;
  z-index: 2;
  max-width: 590px;
  margin-block: auto;
  padding: clamp(58px, 9vh, 108px) 0 clamp(28px, 4vh, 48px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-intro .eyebrow {
  color: #9dd0ff;
}

.intro-content h1,
.form-heading h2 {
  margin: 0;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.intro-content h1 {
  max-width: 570px;
  color: #fff;
  font-size: clamp(2.4rem, 4.4vw, 4.6rem);
}

.intro-lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: #c9dbea;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.benefit-list {
  display: grid;
  gap: 11px;
  margin: 28px 0 0;
  padding: 0;
  color: #e3eef7;
  list-style: none;
}

.benefit-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
}

.benefit-list span {
  color: #8de0ba;
  font-weight: 900;
}

.login-form-panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(36px, 6vw, 80px);
  background:
    radial-gradient(circle at 100% 0%, rgba(224, 240, 253, 0.65), transparent 28%),
    #fff;
}

.mobile-header {
  display: none;
}

.form-shell {
  width: min(100%, 460px);
}

.form-heading {
  margin-bottom: 32px;
}

.form-heading h2 {
  color: var(--navy-950);
  font-size: clamp(2rem, 3.3vw, 2.8rem);
}

.form-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.form-alert,
.validation-summary:not(:empty) {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #f1c5cc;
  border-radius: 12px;
  color: #8e1d31;
  background: var(--danger-bg);
  font-size: 0.9rem;
}

.form-alert > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-weight: 800;
}

.form-alert p,
.validation-summary ul {
  margin: 0;
}

.form-alert-success {
  border-color: #b9e2cf;
  color: #176247;
  background: var(--green-100);
}

.form-alert-success > span { background: var(--green-700); }

.password-policy {
  margin: -10px 0 0;
  padding-inline-start: 22px;
  color: var(--muted);
  font-size: .86rem;
}

.reset-form-shell { width: min(100%, 500px); }

.reset-status {
  display: grid;
  gap: 24px;
}

.reset-status-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #f1c5cc;
  border-radius: 18px;
  color: var(--danger);
  background: var(--danger-bg);
}

.reset-status-icon svg {
  width: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.reset-status-heading { margin-bottom: 0; }

.reset-help-card,
.password-policy-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfe;
}

.reset-help-card h3,
.password-policy-card > p {
  margin: 0;
  color: var(--navy-950);
  font-size: .92rem;
  font-weight: 800;
}

.reset-help-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
}

.password-policy-card {
  margin-top: -6px;
  padding-block: 15px;
}

.password-policy-card ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: .84rem;
  list-style: none;
}

.password-policy-card li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 7px;
}

.password-policy-card li span {
  color: var(--green-700);
  font-weight: 900;
}

.validation-summary:empty {
  display: none;
}

.validation-summary ul {
  padding-inline-start: 18px;
}

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

.form-field > label {
  color: var(--navy-950);
  font-size: 0.91rem;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  min-height: 54px;
  padding: 13px 50px;
  border: 1px solid #c8d7e4;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap input::placeholder {
  color: #8da0b2;
}

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

.input-wrap input:focus {
  border-color: var(--blue-600);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(36, 116, 199, 0.12);
}

.input-wrap input.input-validation-error {
  border-color: var(--danger);
}

.input-wrap input.server-validation-error {
  border-color: var(--danger);
}

.input-icon,
.password-toggle {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
}

.input-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  inset-inline-start: 16px;
  color: #71869a;
  pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.password-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #647b90;
  background: transparent;
  cursor: pointer;
  inset-inline-end: 7px;
}

.password-toggle:hover {
  color: var(--blue-700);
  background: var(--blue-100);
}

.field-validation {
  min-height: 0;
  color: var(--danger);
  font-size: 0.82rem;
}

.field-validation:empty {
  display: none;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #465e75;
  cursor: pointer;
}

.check-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue-700);
}

.forgot-link,
.back-link {
  color: var(--blue-700);
  font-weight: 700;
}

.forgot-link:hover,
.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.submit-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue-700);
  box-shadow: 0 10px 24px rgba(23, 94, 168, 0.22);
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  background: #0f4f91;
  box-shadow: 0 14px 30px rgba(23, 94, 168, 0.28);
}

.submit-button:disabled {
  transform: none;
  background: var(--blue-700);
  box-shadow: 0 10px 24px rgba(23, 94, 168, 0.18);
  cursor: wait;
  opacity: 0.9;
}

.submit-spinner {
  width: 17px;
  height: 17px;
  display: none;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: submit-spinner-rotation 700ms linear infinite;
}

.submit-button.is-loading .submit-spinner {
  display: block;
}

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

@keyframes submit-spinner-rotation {
  to {
    transform: rotate(360deg);
  }
}

.security-note,
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  font-size: 0.82rem;
}

.security-note {
  margin: 24px 0 0;
  color: #75899c;
}

.security-note span {
  color: var(--green-700);
}

.back-link {
  width: fit-content;
  margin: 18px auto 0;
}

[dir="rtl"] body {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

[dir="rtl"] .eyebrow {
  letter-spacing: 0;
}

[dir="rtl"] .intro-content h1,
[dir="rtl"] .form-heading h2 {
  letter-spacing: -0.01em;
  line-height: 1.35;
}

[dir="rtl"] .submit-button > span:last-child,
[dir="rtl"] .back-link > span:first-child {
  transform: scaleX(-1);
}

@media (max-width: 960px) {
  .login-page {
    grid-template-columns: minmax(320px, 0.8fr) minmax(450px, 1.2fr);
  }

  .login-intro {
    padding: 30px;
  }

  .intro-content {
    padding-bottom: 28px;
  }

  .intro-content h1 {
    font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  }

  .login-form-panel {
    padding: 42px;
  }
}

@media (max-width: 760px) {
  .login-page {
    display: block;
    background: #fff;
  }

  .login-intro {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px clamp(22px, 7vw, 54px) 38px;
  }

  .mobile-header {
    width: 100%;
    display: flex;
    margin-bottom: clamp(54px, 10vh, 88px);
  }

  .mobile-header .brand img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .form-shell {
    margin-inline: auto;
  }
}

@media (max-width: 440px) {
  .login-form-panel {
    padding-inline: 18px;
  }

  .mobile-header {
    margin-bottom: 42px;
  }

  .mobile-header .brand img {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .language-switch {
    width: 44px;
    padding: 8px;
  }

  .language-switch > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .form-heading {
    margin-bottom: 26px;
  }

  .form-heading h2 {
    font-size: 1.9rem;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .intro-content {
    padding: 40px 0 22px;
  }

  .benefit-list {
    margin-top: 20px;
  }

  .login-form-panel {
    padding-block: 30px;
  }

  .form-heading {
    margin-bottom: 24px;
  }

  .login-form {
    gap: 17px;
  }

}

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