:root {
  --login-primary: #0066e6;
  --login-primary-dark: #0047b3;
  --login-bg-soft: #f8fafc;
  --login-text-main: #0f172a;
  --login-text-muted: #64748b;
  --login-border: #e2e8f0;
  --login-card: #ffffff;
  --login-danger-bg: #fef2f2;
  --login-danger-border: #fecaca;
  --login-danger-text: #b91c1c;
}

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

.login-page {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--login-bg-soft);
  color: var(--login-text-main);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 43% 57%;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background:
    radial-gradient(circle at top right, rgba(0, 102, 230, 0.08), transparent 35%),
    var(--login-bg-soft);
}

.login-card {
  width: 100%;
  max-width: 520px;
  padding: 48px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.brand-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.brand-logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--login-primary);
}

.login-brand h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--login-text-main);
  line-height: 1.25;
}

.login-brand p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--login-text-muted);
}

.login-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.75rem;
  gap: 0.75rem;
}

.login-separator::before,
.login-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--login-border), transparent);
}

.login-separator-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(0, 102, 230, 0.08);
  color: var(--login-primary);
  font-size: 1rem;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--login-danger-bg);
  border: 1px solid var(--login-danger-border);
  color: var(--login-danger-text);
}

.login-alert i {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.login-form label.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--login-text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  color: var(--login-text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--login-border);
  border-radius: 14px;
  background: var(--login-card);
  color: var(--login-text-main);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: rgba(0, 102, 230, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 102, 230, 0.15);
}

.input-wrapper input::placeholder {
  color: #94a3b8;
}

.input-wrapper--password input {
  padding-right: 5.5rem;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--login-text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.toggle-password:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--login-text-main);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 2px;
}

.login-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
  font-size: 0.875rem;
}

.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--login-text-muted);
  cursor: pointer;
  user-select: none;
}

.login-options input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--login-primary);
  cursor: pointer;
}

.login-options a {
  color: var(--login-primary);
  font-weight: 600;
  text-decoration: none;
}

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

.login-button {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, var(--login-primary) 0%, var(--login-primary-dark) 100%);
  box-shadow: 0 10px 28px rgba(0, 102, 230, 0.28);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.15s ease;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 102, 230, 0.35);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.login-button.is-loading {
  position: relative;
  color: transparent;
}

.login-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.65s linear infinite;
}

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

.login-secure-note {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--login-text-muted);
}

.login-footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--login-text-muted);
}

.login-visual {
  position: relative;
  overflow: hidden;
  background: #0f172a;
  min-height: 100vh;
}

.login-bg-kenburns {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center center;
  animation: kenburns 18s ease-in-out infinite alternate;
}

.login-bg-kenburns--fallback {
  background-image:
    radial-gradient(ellipse 120% 80% at 70% 20%, rgba(0, 102, 230, 0.35), transparent 50%),
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0, 71, 179, 0.4), transparent 45%),
    linear-gradient(160deg, #0b1f3a 0%, #0f172a 45%, #020617 100%);
  animation: kenburns 22s ease-in-out infinite alternate;
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(248, 250, 252, 0.18), rgba(0, 70, 179, 0.08)),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.14), transparent 32%);
  pointer-events: none;
}

@keyframes kenburns {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-18px, -10px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg-kenburns {
    animation: none;
  }
}

@media (max-width: 900px) {
  .login-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .login-visual {
    display: block;
    order: -1;
    flex: 0 0 auto;
    min-height: 200px;
    max-height: 280px;
    width: 100%;
  }

  .login-panel {
    flex: 1 1 auto;
    padding: 24px;
    min-height: 0;
    justify-content: flex-start;
    padding-top: 32px;
  }

  .login-card {
    padding: 32px 24px;
    border-radius: 22px;
  }
}

@media (max-width: 420px) {
  .login-brand h1 {
    font-size: 1.25rem;
  }

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