:root {
  --login-primary: #0071bd;
  --login-primary-dark: #005c99;
  --login-text: #13233f;
  --login-muted: #62738a;
  --login-border: #d9e4ef;
  --login-surface: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--login-text);
  background:
    linear-gradient(
      90deg,
      rgba(247, 251, 255, 0.9) 0%,
      rgba(247, 251, 255, 0.62) 48%,
      rgba(247, 251, 255, 0.28) 100%
    ),
    url("../images/background.png") center / cover no-repeat;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  row-gap: 1.1rem;
}

.login-shell {
  width: min(420px, 100%);
  justify-self: center;
}

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

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

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

.login-card {
  width: 100%;
  min-height: 420px;
  padding: clamp(1.5rem, 3vw, 2.35rem);
  border: 1px solid rgba(217, 228, 239, 0.92);
  border-radius: 18px;
  background: var(--login-surface);
  box-shadow: 0 24px 70px rgba(38, 73, 112, 0.16);
  backdrop-filter: blur(12px);
}

.login-shell--register .login-card {
  min-height: auto;
}

.login-shell--register .login-card {
  padding: clamp(1.2rem, 2.2vw, 1.9rem);
}

.login-card--message {
  text-align: center;
}

.login-card__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f0f7fc;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 189, 0.1);
}

.login-card__icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.login-status-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f0f7fc;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 189, 0.1);
}

.login-status-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--login-text);
}

.login-card__title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.login-card__title span {
  font-size: 1rem;
  font-weight: 800;
  color: inherit;
}

.login-card__title--stacked {
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.login-card__title + .login-form {
  margin-top: 1.35rem;
}

.login-shell--register .login-card h1 {
  font-size: 1.5rem;
}

.login-shell--register .login-card__title span {
  font-size: 0.88rem;
}

.login-shell--register .login-card__title {
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.login-shell--register .login-card__title + .login-form {
  margin-top: 0.85rem;
}

.login-card__subtitle {
  margin: 0.65rem 0 1.8rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--login-muted);
}

.login-card__subtitle--message {
  margin: 0.8rem auto 1rem;
  max-width: 32ch;
  font-size: 0.96rem;
  line-height: 1.5;
}

.login-info-note {
  margin: 0 auto;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(0, 113, 189, 0.22);
  border-radius: 10px;
  background: rgba(0, 113, 189, 0.06);
  color: #22456c;
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 100%;
}

.login-email-pill {
  max-width: 100%;
  margin: 1rem auto 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(0, 113, 189, 0.18);
  border-radius: 10px;
  background: rgba(0, 113, 189, 0.06);
  color: var(--login-primary-dark);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.login-message-actions {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.85rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-shell--register .login-form {
  gap: 0.62rem;
}

.login-shell--register .login-form:has(.input-validation-error) {
  gap: 0.5rem;
}

.login-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.login-form__row > * {
  min-width: 0;
}

.login-shell--register .login-form__row {
  gap: 0.68rem;
}

.login-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.login-shell--register .login-field {
  gap: 0.28rem;
}

.login-shell--register .login-form:has(.input-validation-error) .login-field {
  gap: 0.25rem;
}

.login-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--login-text);
}

.login-control-wrap {
  position: relative;
}

.login-control-icon {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 18px;
  height: 18px;
  color: #6f8198;
  filter: invert(48%) sepia(14%) saturate(557%) hue-rotate(174deg)
    brightness(95%) contrast(88%);
  transform: translateY(-50%);
  pointer-events: none;
}

.login-control {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem 0.75rem 2.7rem;
  border: 1px solid var(--login-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--login-text);
  font: inherit;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.login-control--password {
  padding-right: 3rem;
}

.login-shell--register .login-control {
  min-height: 39px;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

.login-shell--register .login-form:has(.input-validation-error) .login-control {
  min-height: 38px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.login-control::placeholder {
  color: #93a3b6;
}

.login-control:focus {
  border-color: var(--login-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 189, 0.13);
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #6f8198;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  color: var(--login-primary-dark);
  background: rgba(0, 113, 189, 0.08);
  outline: none;
}

.login-password-toggle img {
  width: 19px;
  height: 19px;
  filter: invert(48%) sepia(14%) saturate(557%) hue-rotate(174deg)
    brightness(95%) contrast(88%);
}

.login-validation,
.field-validation-error {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  margin-top: 0.08rem;
  color: #b42318;
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.login-shell--register .login-validation,
.login-shell--register .field-validation-error {
  gap: 0.32rem;
  font-size: 0.72rem;
  line-height: 1.18;
}

.login-validation::before,
.field-validation-error::before {
  content: "!";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 0.04rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.login-shell--register .login-validation::before,
.login-shell--register .field-validation-error::before {
  width: 12px;
  height: 12px;
  font-size: 0.6rem;
}

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

.input-validation-error {
  border-color: #f0a8a1;
  background: #fff8f7;
}

input[type="checkbox"].input-validation-error {
  outline: none;
}

.input-validation-error:focus {
  border-color: #d92d20;
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12);
}

.login-field-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.38rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: #52657c;
  font-size: 0.76rem;
  line-height: 1.28;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.login-field-hint::before {
  content: "i";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 0.01rem;
  border: 1px solid #1a9be8;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #1a9be8;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.login-shell--register .login-field-hint {
  gap: 0.32rem;
  font-size: 0.72rem;
  line-height: 1.18;
}

.login-shell--register .login-field-hint::before {
  width: 12px;
  height: 12px;
  font-size: 0.6rem;
}

.validation-summary-errors {
  margin: 0 0 0.25rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(217, 45, 32, 0.22);
  border-radius: 9px;
  background: #fff8f7;
  color: #b42318;
  font-size: 0.84rem;
  line-height: 1.4;
  font-weight: 600;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1rem;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.15rem;
}

.password-requirements {
  padding: 1.25rem 1.45rem;
  border: 1px solid rgba(0, 113, 189, 0.22);
  border-radius: 9px;
  background: rgb(133, 206, 255, 0.06);
  color: var(--login-text);
}

.password-requirements h2 {
  position: relative;
  margin: 0 0 1rem;
  padding-left: 2.4rem;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 800;
}

.password-requirements h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.2rem;
  width: 24px;
  height: 28px;
  background: url("data:image/svg+xml,%3Csvg width='24' height='28' viewBox='0 0 24 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2.5L21 6.5V13.2C21 18.4 17.45 23.25 12 25.5C6.55 23.25 3 18.4 3 13.2V6.5L12 2.5Z' stroke='%230071BD' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M8 14L10.6 16.6L16.5 10.7' stroke='%230071BD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.password-requirements ul {
  display: grid;
  gap: 0.72rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.password-requirements li {
  position: relative;
  min-height: 20px;
  padding-left: 2.4rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.password-requirements li::before {
  content: "✓";
  position: absolute;
  left: 0.1rem;
  top: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #0071bd;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #0071bd;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.login-link {
  color: var(--login-primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-message-actions .login-secondary-action {
  justify-self: center;
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--login-primary-dark);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-message-actions .login-secondary-action:hover,
.login-message-actions .login-secondary-action:focus-visible {
  color: var(--login-primary);
  text-decoration: underline;
  outline: none;
}

.login-rodo {
  color: var(--login-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.login-rodo h2 {
  margin: 0 0 0.55rem;
  color: var(--login-text);
  font-size: 0.9rem;
  line-height: 1.3;
  font-weight: 700;
}

.login-rodo__content {
  max-height: 126px;
  overflow-y: auto;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--login-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.login-shell--register .login-rodo {
  font-size: 0.78rem;
  line-height: 1.45;
}

.login-shell--register .login-rodo h2 {
  margin-bottom: 0.32rem;
  font-size: 0.82rem;
}

.login-shell--register .login-rodo__content {
  max-height: 72px;
  padding: 0.55rem 0.7rem;
}

.login-shell--register
  .login-form:has(.input-validation-error)
  .login-rodo__content {
  max-height: 58px;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.login-shell--register .login-rodo p {
  margin-bottom: 0.5rem;
}

.login-rodo p {
  margin: 0 0 0.75rem;
}

.login-rodo p:last-child {
  margin-bottom: 0;
}

.login-rodo a {
  color: var(--login-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-rodo a:hover {
  text-decoration: underline;
}

.login-checkbox {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  column-gap: 0.82rem;
  align-items: start;
  color: var(--login-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
  min-width: 0;
}

.login-checkbox-group {
  display: block;
  min-width: 0;
  padding: 0.34rem 0.48rem 0.38rem;
  border: 1px solid transparent;
  border-radius: 9px;
}

.login-shell--register
  .login-form:has(.input-validation-error)
  .login-checkbox-group {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.login-checkbox-group:has(input.input-validation-error) {
  border-color: rgba(217, 45, 32, 0.35);
  background: #fff8f7;
}

.login-checkbox-group:has(input.input-validation-error) .login-checkbox {
  color: var(--login-text);
}

.login-shell--register .login-checkbox {
  column-gap: 0.78rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.login-checkbox input {
  width: 17px;
  height: 17px;
  margin-top: 0.18rem;
  accent-color: var(--login-primary);
  cursor: pointer;
}

.login-checkbox input.input-validation-error {
  box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.35);
  border-radius: 3px;
}

.login-checkbox span {
  min-width: 0;
  display: block;
}

.login-validation--checkbox {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
}

.login-checkbox a {
  color: var(--login-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-checkbox a:hover {
  text-decoration: underline;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 50px;
  margin-top: 0.45rem;
  border: 0;
  border-radius: 9px;
  background: var(--login-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(0, 113, 189, 0.18);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.login-submit--link {
  width: 100%;
  text-decoration: none;
}

.login-submit--link:focus-visible {
  outline: 2px solid rgba(0, 113, 189, 0.35);
  outline-offset: 2px;
}

.login-shell--register .login-submit {
  min-height: 46px;
  margin-top: 0.2rem;
}

.login-submit svg,
.login-submit__icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  flex: 0 0 auto;
}

.login-submit:hover {
  background: var(--login-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(0, 113, 189, 0.22);
}

.login-card__register {
  margin: 1.2rem 0 0;
  text-align: center;
  color: var(--login-muted);
  font-size: 0.95rem;
}

.login-shell--register .login-card__register {
  margin-top: 0.8rem;
  font-size: 0.86rem;
}

.login-footer {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

.login-legal {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--login-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  min-width: 0;
  flex: 1 1 auto;
}

.login-legal span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.login-legal__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: #8da2bd;
  filter: invert(67%) sepia(13%) saturate(568%) hue-rotate(177deg)
    brightness(91%) contrast(89%);
}

.login-legal a {
  color: var(--login-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-legal a:hover {
  text-decoration: underline;
}

.login-corner-logo {
  position: static;
  width: min(118px, 28vw);
  height: auto;
  opacity: 0.95;
  display: block;
  line-height: 0;
  flex: 0 0 auto;
}

.login-corner-logo img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 520px) {
  .login-page {
    min-height: 100svh;
    align-content: start;
    padding: clamp(1.4rem, 5vh, 2.4rem) 1rem 2rem;
  }

  .login-card {
    padding: 1.25rem;
    border-radius: 14px;
    min-height: auto;
  }

  .login-shell--message {
    width: min(430px, 100%);
  }

  .login-status-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .login-status-icon img {
    width: 29px;
    height: 29px;
  }

  .login-card__subtitle--message {
    margin-top: 0.7rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
  }

  .login-info-note {
    padding: 0.65rem 0.8rem;
    font-size: 0.82rem;
  }

  .login-message-actions {
    margin-top: 1rem;
    gap: 0.65rem;
  }

  .login-card__icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0.9rem;
  }

  .login-card__icon img {
    width: 36px;
    height: 36px;
  }

  .login-card h1,
  .login-shell--register .login-card h1 {
    font-size: 1.45rem;
  }

  .login-card__title span,
  .login-shell--register .login-card__title span {
    font-size: 0.86rem;
  }

  .login-card__title + .login-form,
  .login-shell--register .login-card__title + .login-form {
    margin-top: 1rem;
  }

  .login-control {
    min-height: 44px;
  }

  .login-form__row {
    grid-template-columns: 1fr;
  }

  .login-footer {
    position: static;
    margin-top: 1.1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.7rem;
  }

  .login-legal {
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1 1 100%;
    font-size: 0.78rem;
  }

  .login-corner-logo {
    width: min(112px, 36vw);
    margin: 0;
  }
}

@media (max-height: 860px) and (min-width: 521px) {
  .login-page {
    align-items: start;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .login-shell--register .login-card {
    padding: 1.15rem 1.75rem;
  }

  .login-shell--register .login-card__icon {
    width: 46px;
    height: 46px;
    margin-bottom: 0.65rem;
  }

  .login-shell--register .login-card__icon img {
    width: 34px;
    height: 34px;
  }

  .login-shell--register .login-card h1 {
    font-size: 1.4rem;
  }

  .login-shell--register .login-card__title + .login-form {
    margin-top: 0.8rem;
  }

  .login-shell--register .login-control {
    min-height: 40px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .login-shell--register .login-rodo__content {
    max-height: 70px;
  }

  .login-shell--register .login-submit {
    min-height: 44px;
  }
}
