.auth-page {
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(23, 110, 188, 0.16), transparent 32%),
    linear-gradient(180deg, #f5f9fc 0%, #edf3f8 100%);
  color: #17324d;
}

.auth-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.auth-shell--narrow {
  max-width: 760px;
}

.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-brand__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #0f3558;
}

.auth-brand__subtitle {
  margin: 0;
  font-size: 14px;
  color: #4c6882;
}

.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #c6d7e8;
  background: #ffffff;
  color: #204768;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-link-button:hover {
  background: #f4f8fb;
  border-color: #99b9d8;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.auth-aside,
.auth-card {
  border: 1px solid #d2dfeb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(13, 43, 77, 0.08);
}

.auth-aside {
  padding: 28px 24px;
}

.auth-aside__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f1fb;
  color: #1e5f99;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-aside__title {
  margin: 18px 0 10px;
  font-size: 30px;
  line-height: 1.15;
  color: #0f3558;
}

.auth-aside__text {
  margin: 0 0 22px;
  color: #486680;
  line-height: 1.6;
}

.auth-aside__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.auth-aside__list li {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6f9fc;
  color: #284a67;
  line-height: 1.5;
}

.auth-card {
  padding: 28px 24px 24px;
}

.auth-card--single {
  max-width: 680px;
  margin: 0 auto;
}

.auth-card__header {
  margin-bottom: 20px;
}

.auth-card__title {
  margin: 0;
  font-size: 28px;
  color: #123b61;
}

.auth-card__subtitle {
  margin: 8px 0 0;
  color: #56738d;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field--full {
  grid-column: 1 / -1;
}

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: #254867;
}

.auth-field input,
.auth-field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #c0d2e2;
  border-radius: 10px;
  background: #ffffff;
  color: #163552;
  font-size: 14px;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: #2f75bd;
  box-shadow: 0 0 0 3px rgba(47, 117, 189, 0.12);
}

.auth-field--invalid label {
  color: #a12a2a;
}

.auth-field input.auth-input--invalid,
.auth-field select.auth-input--invalid {
  border-color: #d64646;
  background: #fff8f8;
  box-shadow: 0 0 0 3px rgba(214, 70, 70, 0.12);
}

.auth-field__error {
  font-size: 12px;
  line-height: 1.35;
  color: #b03131;
}

.auth-field__error.hidden {
  display: none;
}

.auth-feedback {
  display: grid;
  gap: 12px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.5;
}

.auth-alert.hidden {
  display: none;
}

.auth-alert--error {
  border-color: #efb0b0;
  background: #fff3f3;
  color: #9f1f1f;
}

.auth-alert--success {
  border-color: #b8ddc1;
  background: #f1fbf3;
  color: #17663a;
}

.auth-alert--info {
  border-color: #c8d8ea;
  background: #f4f8fc;
  color: #234d72;
}

.auth-status-card {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #d5e1ed;
  border-radius: 14px;
  background: #f8fbfe;
}

.auth-status-card__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b7790;
}

.auth-status-card__value {
  font-size: 16px;
  color: #143c61;
  word-break: break-word;
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-code-input {
  text-align: center;
  letter-spacing: 0.22em;
  font-size: 24px;
  font-weight: 700;
}

.auth-submit-button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0c5a9a, #0f78ca);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-submit-button:hover {
  filter: brightness(1.03);
}

.auth-submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-secondary-text {
  font-size: 13px;
  color: #55728b;
}

.auth-secondary-text a {
  color: #0f5f9d;
  font-weight: 600;
  text-decoration: none;
}

.auth-secondary-text a:hover {
  text-decoration: underline;
}

.auth-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f5f9d;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-text-button:hover {
  text-decoration: underline;
}

.auth-text-button:disabled {
  color: #7a92a8;
  cursor: not-allowed;
  text-decoration: none;
}

.auth-inline-hint {
  font-size: 12px;
  color: #6b8298;
}

.auth-inline-hint.hidden {
  display: none;
}

#loginDialog .login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 12px 14px 14px;
}

#loginDialog .login-register-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 90px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #c7d0d9;
  background: #ffffff;
  color: #275078;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

#loginDialog .login-register-link:hover {
  background: #f3f7fa;
}

#loginDialog .area-btn {
  margin: 12px 14px 10px;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    padding: 24px 14px 40px;
  }

  .auth-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-form__grid {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .auth-aside {
    padding: 22px 18px;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-submit-button {
    width: 100%;
  }

  #loginDialog {
    width: min(320px, calc(100vw - 24px));
  }

  #loginDialog .login-footer {
    flex-direction: column;
    align-items: stretch;
  }

  #loginDialog .login-register-link {
    width: 100%;
  }
}
