@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ======================
   TOKENS (matches home.css)
====================== */
:root {
  --bg: #0a0c0e;
  --surface: #131619;
  --surface-2: #191d22;
  --surface-3: #20252b;

  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #edeef0;
  --text-dim: #8b9098;
  --text-faint: #565c63;

  --accent: #4fd8c4;
  --accent-strong: #7ee8d8;
  --accent-dim: rgba(79, 216, 196, 0.1);
  --accent-border: rgba(79, 216, 196, 0.3);

  --danger: #e5484d;
  --danger-dim: rgba(229, 72, 77, 0.12);
  --danger-border: rgba(229, 72, 77, 0.3);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  overflow: hidden;
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-dim);
  color: var(--accent-strong);
}

/* ======================
   AMBIENT BACKGROUND (matches home.css)
====================== */
.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse 900px 500px at 10% -10%,
      rgba(79, 216, 196, 0.07),
      transparent 60%
    ),
    radial-gradient(
      ellipse 700px 500px at 100% 110%,
      rgba(79, 216, 196, 0.05),
      transparent 60%
    ),
    linear-gradient(180deg, #0a0c0e 0%, #0d1013 55%, #0a0c0e 100%);
}

.background::before,
.background::after {
  content: '';
  position: absolute;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  inset: 0;
  mask-image: radial-gradient(
    ellipse 70% 70% at 50% 40%,
    #000 0%,
    transparent 75%
  );
}

/* ======================
   LOGIN CARD
====================== */
.login-container {
  position: relative;
  z-index: 5;
  width: 420px;
  padding: 44px;
  border-radius: var(--r-lg);
  background: rgba(19, 22, 25, 0.75);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  animation: rise-in 0.3s var(--ease);
}

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

.logo {
  text-align: center;
  margin-bottom: 34px;
}

/* shield → chip glyph, matches the vault card icon in home.css */
.shield {
  width: 46px;
  height: 34px;
  margin: 0 auto 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--surface-3), #262b32);
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}

.shield::before,
.shield::after {
  content: '';
  position: absolute;
  background: rgba(79, 216, 196, 0.35);
}

.shield::before {
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  box-shadow:
    0 -7px 0 rgba(79, 216, 196, 0.2),
    0 7px 0 rgba(79, 216, 196, 0.2);
}

.shield::after {
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.input-group label {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

.input-group input {
  height: 50px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.input-group input::placeholder {
  color: var(--text-faint);
}

.input-group input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-error {
  color: #ffb3b3;
  background: var(--danger-dim);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.options {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 13.5px;
}

.remember {
  display: flex;
  gap: 8px;
  color: var(--text-dim);
  align-items: center;
}

.options a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.options a:hover {
  color: var(--accent-strong);
}

button {
  height: 52px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #06110f;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s var(--ease);
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(79, 216, 196, 0.35);
}

.register {
  text-align: center;
  color: var(--text-dim);
  margin-top: 6px;
  font-size: 13.5px;
}

.register a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.register a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

@media (max-width: 500px) {
  .login-container {
    width: 92%;
    padding: 34px 24px;
  }

  .logo h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
