:root {
  color-scheme: light dark;
  --bg: #f3f3f3;
  --card: #ffffff;
  --text: #212529;
  --muted: #707070;
  --muted-2: #9a9a9a;
  --border: #dfdfdf;
  --input-border: #ced4da;
  --accent: #0d6efd;
  --accent-hover: #0b5ed7;
  --ok: #198754;
  --error: #dc3545;
  --sans: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 20px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --card: #242424;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --muted-2: #757575;
    --border: #3a3a3a;
    --input-border: #444;
  }
}

* { box-sizing: border-box; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.45; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
}

/* Soft glow behind the logo mark, top-left of the viewport. */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  left: -100px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* The goned.studio logo mark, top-left corner. Its own fill is a fixed dark
   color (not currentColor), so it's inverted in dark mode to stay visible
   against a dark background. */
body::after {
  content: '';
  position: fixed;
  top: 28px;
  left: 28px;
  width: 72px;
  height: 44px;
  background-image: url('logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  z-index: 2;
  animation: fadeSlideUp 0.5s var(--ease-fluid) both;
}

@media (prefers-color-scheme: dark) {
  body::after {
    filter: invert(1) brightness(1.8);
  }
}

/* Scale everything up a bit on very large monitors - fixed px sizing
   otherwise stays the same regardless of screen size, which reads as too
   small on a 2500px+ display. Targets <html>, not body: all component sizes
   below are in rem, which is relative to the root element's font-size, not
   body's own. */
@media (min-width: 1921px) {
  html { font-size: 18px; }
}
@media (min-width: 2560px) {
  html { font-size: 20px; }
}

.page-top {
  width: 100%;
  max-width: 400px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeSlideUp 0.5s var(--ease-fluid) both;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color .2s var(--ease-fluid);
}

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

.lang-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-switch-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  transition: color .3s var(--ease-fluid);
  user-select: none;
}

.lang-switch-label.active { color: var(--text); }

.lang-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .3s var(--ease-fluid);
}

.lang-switch.is-en { background: var(--accent); }

.lang-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform .3s var(--ease-fluid);
}

.lang-switch.is-en .lang-switch-knob { transform: translateX(18px); }

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: fadeSlideUp 0.5s var(--ease-fluid) 0.08s both;
}

h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 8px;
}

p.lead {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 14px;
  transition: border-color .2s var(--ease-fluid), box-shadow .2s var(--ease-fluid), transform .2s var(--ease-fluid);
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
  transform: translateY(-1px);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  width: 100%;
  padding: 11px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s var(--ease-fluid), border-color .2s var(--ease-fluid), transform .2s var(--ease-fluid);
}

button[type="submit"]:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button[type="submit"]:active:not(:disabled) { transform: scale(0.98); }
button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: default;
  animation: pulse 1.4s ease-in-out infinite;
}

.msg {
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  min-height: 1.3em;
}

.msg.error { color: var(--error); }
.msg.success { color: var(--ok); }
.msg.msg-animate { animation: popIn 0.3s var(--ease-fluid) both; }

a { color: var(--accent); }

.support-contact {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-2);
  line-height: 1.6;
}

.support-contact a { color: var(--muted); font-weight: 500; }
.support-contact a:hover { color: var(--accent); }

@media (max-width: 420px) {
  .card { padding: 22px 18px; }
  h1 { font-size: 1.25rem; }
  p.lead { font-size: 0.85rem; }
}

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