@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700&display=swap");

:root,
[data-theme="dark"] {
  --bg: #09090b;
  --surface: rgba(24, 24, 27, 0.85);
  --input-bg: rgba(9, 9, 11, 0.55);
  --text: #fafafa;
  --muted: #71717a;
  --text-secondary: #a1a1aa;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-soft: rgba(6, 182, 212, 0.14);
  --accent-glow: rgba(6, 182, 212, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.2);
  --hover-bg: rgba(255, 255, 255, 0.04);
  --link: #67e8f9;
  --radius-md: 16px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-normal: 220ms;
  --duration-slow: 480ms;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font: var(--font-body);
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.35);
  --error-text: #fca5a5;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: rgba(34, 197, 94, 0.35);
  --success-text: #86efac;
}

[data-theme="light"] {
  --bg: #fafafa;
  --surface: rgba(255, 255, 255, 0.95);
  --input-bg: #ffffff;
  --text: #09090b;
  --muted: #71717a;
  --text-secondary: #52525b;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-glow: rgba(6, 182, 212, 0.22);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-hover: rgba(0, 0, 0, 0.18);
  --hover-bg: rgba(0, 0, 0, 0.04);
  --link: #0e7490;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.3);
  --error-text: #b91c1c;
  --success-bg: rgba(34, 197, 94, 0.1);
  --success-border: rgba(34, 197, 94, 0.3);
  --success-text: #15803d;
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 90% 60% at 50% -30%, rgba(6, 182, 212, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(20, 184, 166, 0.06), transparent 50%),
    var(--bg);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 90% 60% at 50% -30%, rgba(6, 182, 212, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(20, 184, 166, 0.1), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem 2rem 2rem;
  box-shadow: none;
}

@media (prefers-reduced-motion: no-preference) {
  [data-page-enter] {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity var(--duration-slow) var(--ease-out) var(--enter-delay, 0ms),
      transform var(--duration-slow) var(--ease-out) var(--enter-delay, 0ms);
  }

  [data-page-enter].is-entered {
    opacity: 1;
    transform: translateY(0);
  }

  .auth-card {
    animation: auth-card-enter var(--duration-slow) var(--ease-out) both;
  }
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes auth-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.auth-back {
  margin: 0;
  font-size: 0.8125rem;
}

.auth-back a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.auth-back a:hover {
  color: var(--link);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  transition: opacity 150ms ease;
}

.site-logo:hover {
  opacity: 0.88;
}

.site-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.auth-page-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  transition:
    border-color var(--duration-normal) ease,
    box-shadow var(--duration-normal) ease,
    transform var(--duration-normal) var(--ease-out);
}

input:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

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

.auth-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: -0.5rem 0 1rem;
}

button[type="submit"] {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #14b8a6 100%);
  color: #fff;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    filter var(--duration-normal) ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--accent-glow);
  filter: brightness(1.06);
}

button[type="submit"]:active {
  transform: scale(0.98);
  filter: brightness(0.96);
}

.auth-forgot a {
  position: relative;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.auth-forgot a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--duration-normal) var(--ease-out);
}

.auth-forgot a:hover::after {
  width: 100%;
}

.auth-forgot a:hover {
  color: #c7d2fe;
}

.auth-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.auth-error a {
  color: inherit;
  font-weight: 500;
}

.auth-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.auth-footer {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  color: #c7d2fe;
}

.auth-support {
  margin-top: 0.75rem;
}

.auth-dev-link {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.22);
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  word-break: break-all;
  line-height: 1.5;
}

.auth-dev-link a {
  color: var(--link);
  text-decoration: none;
}

.auth-forgot {
  display: block;
  text-align: right;
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  [data-page-enter] {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  input:focus {
    transform: none;
  }

  button[type="submit"]:hover,
  button[type="submit"]:active {
    transform: none;
  }
}
