/* Reset & tokens */
:root {
  --nts-blue: #3c8dbc;
  --nts-blue-dark: #357ca5;
  --surface: #ffffff;
  --text-primary: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius-card: 18px;
  --radius-input: 12px;
}

* {
  box-sizing: border-box;
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, var(--nts-blue) 0%, #367fa9 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.login-message-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  z-index: 10;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-shell {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-panel {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow:
    0 20px 55px rgba(15, 23, 42, 0.25),
    0 0 1px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.login-panel__header {
  padding: 48px 40px 32px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}

.login-panel__logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 20px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-panel__logo img:hover {
  transform: scale(1.05);
}

.login-panel__eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 6px;
}

.login-panel__brand {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text-primary);
}

.login-panel__subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.login-form {
  padding: 32px 40px 28px;
}

.input-field {
  margin-bottom: 22px;
}

.input-field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

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

.input-field__icon {
  position: absolute;
  left: 18px;
  color: #9ca3af;
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-field__input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 15px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-field__input:hover {
  border-color: #d1d5db;
}

.input-field__input:focus {
  outline: none;
  border-color: var(--nts-blue);
  box-shadow: 0 0 0 4px rgba(60, 141, 188, 0.12);
}

.input-field__input:focus::placeholder {
  color: #cbd5f5;
}

.input-field__control:focus-within .input-field__icon {
  color: var(--nts-blue);
}

.login-button {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-input);
  background: var(--nts-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-button:hover {
  background: var(--nts-blue-dark);
  box-shadow: 0 8px 20px rgba(60, 141, 188, 0.25);
  transform: translateY(-1px);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(60, 141, 188, 0.2);
}

.login-button:focus-visible {
  outline: 2px solid rgba(60, 141, 188, 0.4);
  outline-offset: 4px;
}

.login-panel__footer {
  padding: 18px 40px 28px;
  border-top: 1px solid #f3f4f6;
  text-align: center;
}

.login-panel__version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
  background: #f3f4f6;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(6px);
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 520px) {
  .login-panel__header,
  .login-form,
  .login-panel__footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .login-panel__header {
    padding-top: 40px;
    padding-bottom: 24px;
  }

  .input-field__input {
    height: 48px;
    padding-left: 44px;
  }

  .login-button {
    height: 48px;
  }
}