:root {
  --login-bg: #eef2f8;
  --login-surface: #ffffff;
  --login-line: #d5ddec;
  --login-line-strong: #c2cde3;
  --login-text: #17243d;
  --login-muted: #5e6c86;
  --login-primary: #1e4fbf;
  --login-primary-strong: #193f97;
  --login-accent: #f08a24;
  --login-success-bg: #edf8f2;
  --login-success-line: #bde6cc;
  --login-success-text: #126642;
  --login-error-bg: #fff1ef;
  --login-error-line: #ffcfc9;
  --login-error-text: #a8392f;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--login-text);
  overflow-x: hidden;
  background:
    radial-gradient(820px 420px at 14% -14%, #d7e6ff 0%, transparent 68%),
    radial-gradient(780px 460px at 96% 8%, #ffe8d2 0%, transparent 68%),
    var(--login-bg);
}

.login-wrap {
  position: relative;
  min-height: 100vh;
  padding: 34px;
  display: grid;
  place-items: center;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.06));
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.login-card,
.login-branding-card {
  border: 1px solid var(--login-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--login-surface) 94%, transparent);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 36px rgba(16, 25, 44, 0.12);
}

.login-card {
  padding: 26px 24px;
  display: grid;
  gap: 18px;
}

.login-header h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0.01em;
}

.login-header p {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 17px;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--login-error-line);
  background: var(--login-error-bg);
  color: var(--login-error-text);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  line-height: 1.35;
}

.login-error svg {
  margin-top: 2px;
  flex-shrink: 0;
}

.login-form,
.forgot-form {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.form-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #41526f;
}

.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--login-line-strong);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--login-text);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input::placeholder,
textarea.input::placeholder {
  color: #8a96ad;
}

.form-group.focused .input,
.input:focus,
textarea.input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(30, 79, 191, 0.14);
}

.textarea-md {
  min-height: 92px;
  resize: vertical;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--login-muted);
  cursor: pointer;
}

.checkbox-input {
  margin: 0;
}

.forgot-password,
.request-access-link {
  color: var(--login-primary);
  font-weight: 700;
  text-decoration: none;
}

.forgot-password:hover,
.request-access-link:hover {
  text-decoration: underline;
}

.btn,
.btn-login {
  border: 1px solid var(--login-primary);
  background: var(--login-primary);
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .1s ease;
}

.btn:hover,
.btn-login:hover {
  background: var(--login-primary-strong);
  border-color: var(--login-primary-strong);
}

.btn:active,
.btn-login:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.login-footer {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e3e9f5;
  font-size: 15px;
  color: var(--login-muted);
}

.login-branding {
  display: block;
}

.login-branding-card {
  height: 100%;
  padding: 30px 26px;
  display: grid;
  align-content: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.login-branding-card::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  right: -55px;
  bottom: -70px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffd9b4 0%, #ffbc7a 58%, #f08a24 100%);
  opacity: 0.18;
}

.login-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.login-branding-card h2 {
  margin: 2px 0 0;
  font-size: 36px;
  line-height: 1;
}

.login-branding-card p {
  margin: 0;
  color: var(--login-muted);
  font-size: 17px;
  line-height: 1.45;
  max-width: 40ch;
}

.login-branding-points {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.login-branding-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2f456a;
  font-size: 15px;
  font-weight: 600;
}

.login-branding-points li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--login-accent);
  box-shadow: 0 0 0 3px rgba(240, 138, 36, 0.18);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal-overlay.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(14, 23, 39, 0.56);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--login-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 44px rgba(12, 21, 37, 0.28);
}

.modal-content.modal-lg {
  width: min(640px, calc(100vw - 28px));
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f5;
}

.modal-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  background: #fff;
  color: #4b5c78;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f5f8fe;
}

.modal-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.modal-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--login-muted);
}

.alert {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.alert-success {
  background: var(--login-success-bg);
  border-color: var(--login-success-line);
  color: var(--login-success-text);
}

.alert-error {
  background: var(--login-error-bg);
  border-color: var(--login-error-line);
  color: var(--login-error-text);
}

.is-hidden {
  display: none !important;
}

body.has-modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .login-wrap {
    padding: 16px;
  }

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

  .login-branding {
    order: 2;
  }

  .login-branding-card {
    padding: 20px;
    gap: 10px;
  }

  .login-branding-card h2 {
    font-size: 28px;
  }

  .login-branding-card p {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 20px 16px;
  }

  .login-branding-card {
    padding: 22px 18px;
  }

  .login-header h1 {
    font-size: 34px;
  }

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

  .modal-header h2 {
    font-size: 24px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-content.modal-lg {
    width: min(640px, calc(100vw - 24px));
    border-radius: 16px;
  }

  .modal-body {
    padding: 14px;
  }
}
