/* Secure sign-in page — isolated stylesheet so the dashboard CSS never leaks here. */

:root {
  --ink: #E8EEF7;
  --muted: #93A4BF;
  --emerald: #10B981;
  --emerald-deep: #047857;
  --card: rgba(13, 21, 36, 0.86);
  --border: rgba(122, 148, 186, 0.22);
  --danger: #F87171;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(16, 185, 129, 0.20), transparent 62%),
    radial-gradient(900px 540px at 88% 8%, rgba(37, 99, 235, 0.20), transparent 60%),
    #060B14;
  color: var(--ink);
  font-family: "Segoe UI", "Outfit", system-ui, -apple-system, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(122, 148, 186, 0.055) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(122, 148, 186, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 26px;
  gap: 18px;
}

.login-card {
  width: 100%;
  max-width: 424px;
  padding: 34px 32px 26px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 28px 70px -28px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #04121A;
  background: linear-gradient(135deg, var(--emerald), #34D399);
  box-shadow: 0 8px 22px -10px rgba(16, 185, 129, 0.9);
  flex: 0 0 auto;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.2;
}

.login-brand h1 span { color: var(--emerald); }

.login-brand p {
  margin: 4px 0 0;
  font-size: 0.71rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-form { display: flex; flex-direction: column; gap: 15px; }

.login-field { display: flex; flex-direction: column; gap: 7px; }

.login-field > span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-field input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(4, 10, 20, 0.75);
  color: var(--ink);
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.login-field input::placeholder { color: rgba(147, 164, 191, 0.55); }

.login-field input:focus {
  outline: none;
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.login-password-row { position: relative; display: flex; }
.login-password-row input { padding-right: 62px; }

.login-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 8px;
  border: none;
  border-radius: 7px;
  background: rgba(122, 148, 186, 0.14);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  cursor: pointer;
}

.login-eye:hover { color: var(--ink); background: rgba(122, 148, 186, 0.26); }

.login-alert {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.79rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.login-alert.visible { display: block; }

.login-alert.error {
  color: #FECACA;
  background: rgba(185, 28, 28, 0.16);
  border-color: rgba(248, 113, 113, 0.42);
}

.login-alert.info {
  color: #BAE6FD;
  background: rgba(2, 132, 199, 0.16);
  border-color: rgba(56, 189, 248, 0.38);
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: #03130D;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 30px -18px rgba(16, 185, 129, 0.95);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.login-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.login-submit:disabled { cursor: not-allowed; opacity: 0.72; }

.login-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(3, 19, 13, 0.35);
  border-top-color: #03130D;
  animation: login-spin 0.7s linear infinite;
}

@keyframes login-spin { to { transform: rotate(360deg); } }

.login-totp {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.07);
}

.login-totp.hidden { display: none; }

.login-totp .login-field input {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.22em;
  text-align: center;
}

.login-totp-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

.login-link {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: var(--emerald);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.login-link:hover { color: #34D399; }

.login-back {
  margin-top: 2px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.login-back:hover { color: var(--ink); background: rgba(122, 148, 186, 0.12); }
.login-back.hidden { display: none; }

body.step-second-factor .login-brand p::after {
  content: " · 2FA";
  color: var(--emerald);
}

.login-help {
  margin: 14px 0 0;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

.login-help strong { color: var(--ink); font-weight: 700; }

.login-help code {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(122, 148, 186, 0.14);
  color: var(--ink);
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.68rem;
}

.login-footnote {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.71rem;
  line-height: 1.5;
  color: var(--muted);
}

.login-lock { font-size: 0.8rem; line-height: 1.3; }

.login-legal {
  margin: 0;
  max-width: 424px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.55;
  color: rgba(147, 164, 191, 0.72);
}

@media (max-width: 480px) {
  .login-card { padding: 26px 20px 20px; border-radius: 16px; }
  .login-brand h1 { font-size: 0.94rem; }
}
