/* css/auth.css – login & signup. Load AFTER tokens.css. Keeps your existing class names. */

*, *::before, *::after { box-sizing: border-box; }   /* fixes inputs overflowing the card */
html { color-scheme: dark; }                          /* dark dropdowns, scrollbars, autofill */

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  font-family: var(--font);                           /* Inter was loaded but never applied */
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Ice glow, zero image weight */
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(143, 200, 240, .16), transparent 60%),
    radial-gradient(700px 520px at 100% 100%, rgba(90, 110, 143, .24), transparent 60%),
    var(--bg);
}

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

/* ---------- brand mark above the card (links home) ---------- */
.auth-brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.auth-brand svg { width: 34px; height: 34px; }
.auth-brand .word { font-weight: 600; letter-spacing: .22em; font-size: .95rem; color: var(--frost); }
.auth-brand .word b { font-weight: 300; color: var(--ice); }

/* ---------- card ---------- */
.auth-container {
  width: min(440px, 100%);
  background: rgba(22, 35, 59, .45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.4rem 2rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: slideUp .5s var(--ease) both;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.auth-container h2 { margin: 0 0 .4rem; color: var(--frost); font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em; text-align: center; }
.auth-container > p { margin: 0 0 1.8rem; text-align: center; color: var(--muted); font-size: .92rem; }

/* ---------- fields ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: .4rem; font-size: .82rem; font-weight: 500; color: var(--ice-soft); }

.form-group input,
.form-group select {
  width: 100%;
  min-height: 46px;
  padding: .75rem 1rem;
  font: 400 1rem var(--font);                         /* 16px stops iOS zooming on focus */
  color: var(--text);
  background: rgba(7, 11, 20, .6);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.form-group input::placeholder { color: rgba(214, 228, 246, .36); }
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ice);
  background: rgba(7, 11, 20, .8);
  box-shadow: 0 0 0 3px rgba(143, 200, 240, .16);
}
.form-group input:user-invalid,
.form-group select:user-invalid { border-color: rgba(240, 128, 128, .6); }

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FC8F0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 18px;
}
.form-group select option { background: #0B1424; color: var(--text); }

/* Show / Hide password (wired by js/auth-ui.js) */
.pw { position: relative; }
.pw input { padding-right: 4.6rem; }
.pw-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; border-radius: 8px; padding: .4rem .65rem;
  font: 500 .8rem var(--font); color: var(--ice); cursor: pointer;
}
.pw-toggle:hover { color: var(--frost); }

/* ---------- button (pill, same as the homepage) ---------- */
.btn-primary {
  width: 100%;
  margin-top: .8rem;
  padding: .9rem 1.4rem;
  border: 0;
  border-radius: 99px;
  background: var(--ice);
  color: #07101C;
  font: 600 1rem var(--font);
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.btn-primary:hover { background: var(--ice-soft); transform: translateY(-2px); box-shadow: 0 10px 25px -10px rgba(143, 200, 240, .55); }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }

/* ---------- messages & links ---------- */
.error-msg {
  display: none;                                      /* your JS switches it on */
  margin: .2rem 0 0;
  padding: .7rem .9rem;
  border: 1px solid rgba(240, 128, 128, .35);
  border-radius: 12px;
  background: rgba(240, 128, 128, .08);
  color: #F7C1C1;
  font-size: .86rem;
  text-align: center;
}
.auth-link { display: block; margin-top: 1.5rem; text-align: center; font-size: .9rem; color: var(--muted); }
.auth-link a { color: var(--ice); font-weight: 500; text-decoration: none; transition: color .2s; }
.auth-link a:hover { color: var(--frost); }

@media (max-width: 420px) { .auth-container { padding: 2rem 1.3rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
