/* =============================================================================
 *  ui/auth.css
 *  Sign in, create an account, forgotten password, sign out: one calm card in
 *  the middle of the page, under the shared top bar. Loaded after rekhyt-ui.css.
 *  The pages themselves are written by lib/auth-routes.js.
 * ========================================================================== */
html.na body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 64px; }
.auth-card { width: 100%; max-width: 430px; padding: 34px 32px 30px; }
.auth-card h1 { margin: 0 0 6px; color: var(--ink); font: 700 28px/1.15 var(--ui); letter-spacing: -.015em; }
.auth-card .auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.auth-card p.sub { margin: 0 0 18px; color: var(--text); font-size: 15.5px; line-height: 1.6; }

/* fields */
.auth-card form { margin: 0; }
.auth-card label { display: block; margin: 16px 0 7px; color: var(--ink); font: 600 14.5px/1.3 var(--ui); }
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--page); color: var(--ink);
  font: 400 16px var(--ui);   /* 16px or iPhones zoom in on the field */
}
/* "Who told you about Rekhyt?" on the sign up form */
.auth-card select {
  width: 100%; height: 48px; padding: 0 40px 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236B6480' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 18px 18px no-repeat;
  color: var(--ink); font: 400 16px var(--ui);
  -webkit-appearance: none; appearance: none;
}
.auth-card select:hover { border-color: rgba(var(--brand-rgb), .55); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.auth-card select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
html[data-style="night"] .auth-card select { background-color: var(--surface-2); }
.auth-card label .optional { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 13.5px; }
.auth-card .heard-other[hidden] { display: none; }
.auth-card .heard-other label { margin-top: 16px; }
html[data-style="night"] .auth-card input { background: var(--surface-2); }
.auth-card input:hover { border-color: rgba(var(--brand-rgb), .55); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.auth-card input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.auth-card .hint { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

/* Show / Hide beside a password (added by auth.js, so it is only there when it works) */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-width: 60px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--brand); font: 600 14px/1 var(--ui); cursor: pointer;
}
.pw-toggle:hover { background: var(--brand-soft); }

/* the one main button */
.auth-card button[type="submit"] {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 48px; margin-top: 24px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink);
  font: 600 16px/1 var(--ui); cursor: pointer; transition: background-color .15s;
}
.auth-card button[type="submit"]:hover { background: var(--brand-hover); }

/* notes from the server: wrong password, link sent, and so on */
.auth-card .msg {
  margin: 0 0 20px; padding: 12px 14px; border-radius: 12px;
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  color: var(--ink); font-size: 15px; line-height: 1.55;
}
.auth-card .msg.ok { background: var(--surface-2); }

/* small links under the form */
.auth-card .links { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 2; }
.auth-card .links a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-card .links a:hover { text-decoration: underline; }
.auth-back { margin: 20px 0 0; font-size: 15px; }
.auth-back a { color: var(--muted); text-decoration: none; }
.auth-back a:hover { color: var(--brand); }

@media (max-width: 520px) {
  .auth-main { justify-content: flex-start; padding: 24px 16px 40px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 14px; }
  .auth-card h1 { font-size: 25px; }
}
