/* Login page — mobile-first, scales up to desktop. Shares the dashboard's light palette via style.css. */

.login-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(1100px 540px at 50% -10%, rgba(47, 109, 244, 0.18), transparent 60%),
    radial-gradient(900px 520px at 50% 110%, rgba(26, 170, 91, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.login-hero {
  text-align: center;
  perspective: 1000px;
}

.login-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
  margin-bottom: 14px;
}

.login-banner {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: clamp(36px, 9vw, 56px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.05;
  cursor: default;
  user-select: none;
  text-shadow:
    0 1px 0 #d3d6e0,
    0 2px 0 #c8cbd6,
    0 3px 0 #bbbfcc,
    0 4px 0 #aeb3c2,
    0 5px 0 #a1a7b8,
    0 6px 12px rgba(20, 24, 38, 0.16);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(0deg) rotateY(0deg) translateZ(0);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1.0), text-shadow 0.45s ease;
  will-change: transform;
}

@media (hover: hover) {
  .login-banner:hover {
    transform: perspective(900px) rotateX(12deg) rotateY(-10deg) translateZ(22px) scale(1.04);
    text-shadow:
      1px 1px 0 #2f6df4,
      2px 2px 0 #2860dc,
      3px 3px 0 #2154c4,
      4px 4px 0 #1b48ac,
      5px 5px 0 #143c95,
      6px 6px 0 #0e317d,
      7px 7px 0 #082666,
      9px 9px 22px rgba(47, 109, 244, 0.4),
      -2px -2px 0 #1aaa5b;
    animation: loginWobble 1.6s ease-in-out infinite;
  }
  @keyframes loginWobble {
    0%, 100% { transform: perspective(900px) rotateX(12deg) rotateY(-10deg) translateZ(22px) scale(1.04); }
    50%      { transform: perspective(900px) rotateX(8deg)  rotateY(-14deg) translateZ(26px) scale(1.05); }
  }
}

.login-tag {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow:
    0 1px 2px rgba(20, 24, 38, 0.04),
    0 18px 40px -16px rgba(20, 24, 38, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-label input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px; /* >=16px keeps iOS Safari from zooming on focus */
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.login-label input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-password {
  position: relative;
}
.login-password input { padding-right: 44px; }
.login-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.login-eye:hover { color: var(--ink-soft); background: var(--surface-alt); }
.login-eye:focus { outline: 2px solid var(--accent-soft); }

.login-submit {
  position: relative;
  height: 50px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 6px 16px -6px rgba(47, 109, 244, 0.5);
}
.login-submit:hover  { background: #2558d4; }
.login-submit:active { transform: translateY(1px); box-shadow: 0 3px 10px -4px rgba(47, 109, 244, 0.5); }
.login-submit:disabled { opacity: 0.65; cursor: progress; }

.login-submit-spinner {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.login-submit.loading .login-submit-spinner { display: block; }
.login-submit.loading .login-submit-label { opacity: 0.65; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #f6c8c8;
}

.login-foot {
  text-align: center;
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Slightly more breathing room on roomy screens. */
@media (min-width: 700px) {
  .login-card { padding: 28px 26px 22px; }
  .login-shell { gap: 32px; }
}

/* Respect users who prefer no motion. */
@media (prefers-reduced-motion: reduce) {
  .login-banner, .login-banner:hover { animation: none; transition: none; }
  .login-submit-spinner { animation: none; }
}
