/* RMS DocSync — Login Screen
   Design system: palette (blue gradient, cyan accent, white card),
   typography (Inter body, Space Grotesk logo), rotating gears */

/* ── Reset ── */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a {
  color: #1e5fc9;
  text-decoration: none;
}

a:hover {
  color: #14297D;
}

/* ── Page background ── */
.login-page {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e5fc9 0%, #4a90e2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Container with ghost cards ── */
.login-container {
  position: relative;
  width: 90%;
  max-width: 1100px;
  margin-top: 44px;
  margin-bottom: 40px;
}

/* Ghost cards behind main card */
.login-ghost {
  position: absolute;
  border-radius: 10px;
  z-index: 0;
  left: 50%;
}

.login-ghost--top {
  width: 78%;
  height: 40px;
  top: -32px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.12);
}

.login-ghost--mid {
  width: 90%;
  height: 40px;
  top: -16px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.22);
}

/* ── Main card ── */
.login-card {
  position: relative;
  z-index: 2;
  background: white;
  border-radius: 16px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  min-height: 580px;
}

/* ── Left panel: illustration ── */
.login-card__left {
  flex: 1;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.login-illustration {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

/* ── Right panel: form ── */
.login-card__right {
  flex: 1;
  padding: 50px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Logo ── */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
}

.login-logo img {
  width: 160px;
  height: auto;
}

/* ── Form header ── */
.login-form-header {
  margin-bottom: 32px;
  text-align: center;
}

.login-form-header__title {
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
}

.login-form-header__sub {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Form fields ── */
.login-field {
  margin-bottom: 22px;
}

.login-field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 8px;
}

.login-field__input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 120ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 120ms cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}

.login-field__input:focus {
  outline: none;
  border-color: #22D3EE;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.login-field__input--error {
  border-color: #ef4444;
}

/* Password wrapper */
.login-password-wrap {
  position: relative;
}

.login-password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.login-password-toggle:hover {
  color: #4b5563;
}

/* ── Errors ── */
.login-field__error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

.login-errors {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #dc2626;
}

.login-errors ul {
  margin: 0;
  padding-left: 18px;
}

.login-errors li {
  margin-bottom: 2px;
}

/* ── Submit button ── */
.login-submit {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1e5fc9 0%, #4a90e2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}

.login-submit:hover {
  filter: brightness(1.08);
}

.login-submit:active {
  transform: scale(0.97);
}

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

/* ── Footer link ── */
.login-footer {
  text-align: center;
  margin-top: 36px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.login-footer a {
  color: white;
  font-weight: 600;
}

.login-footer a:hover {
  opacity: 0.8;
  color: white;
}

/* ── Gears animation ── */
@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gear-spin-rev {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

.gear-a { transform-origin: 110px 130px; animation: gear-spin 12s linear infinite; }
.gear-b { transform-origin: 270px 230px; animation: gear-spin-rev 8s linear infinite; }
.gear-c { transform-origin: 300px 340px; animation: gear-spin 5s linear infinite; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .login-card {
    flex-direction: column;
    min-height: auto;
  }

  .login-card__left {
    padding: 36px 20px;
    min-height: 260px;
  }

  .login-card__right {
    padding: 36px 24px;
  }

  .login-form-header__title {
    font-size: 24px;
  }

  .login-ghost--top {
    width: 84%;
  }

  .login-ghost--mid {
    width: 94%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gear-a, .gear-b, .gear-c {
    animation: none;
  }
}
