/* Auth pages (login, signup, password reset) — Ribbon look, sharing the
   marketing palette + fonts from home.css. Logged-in account pages keep
   account/app.css and are unaffected. */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  font-size: 15px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
}

.auth-brand .logo {
  width: 36px; height: 36px;
  font-size: 22px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
}
.auth-brand .logo:hover { text-decoration: none; }

.auth-brand .brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

/* Messages */
.auth-messages { margin-bottom: 20px; }
.auth-message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.auth-message.error { border-color: rgba(181, 69, 58, 0.3); color: var(--diff-del); }
.auth-message.success { border-color: rgba(74, 124, 58, 0.3); color: var(--diff-add); }
.auth-message.warning { border-color: rgba(181, 142, 64, 0.35); color: #987e1b; }

/* Headings */
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

/* Paragraphs */
.auth-card p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}
.auth-card p a { color: var(--primary); }

/* "Sign up" / "Sign in" alternate link below the form */
.auth-card .auth-alt {
  margin-top: 24px;
  margin-bottom: 0;
  font-size: 13px;
}
.auth-card .auth-alt a { font-weight: 600; }

/* Forms */
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* form.as_p output */
.auth-card form p {
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-card form label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

/* The "as_p" hidden fields (csrf etc) — hide the wrapping <p> */
.auth-card form p:has(input[type="hidden"]) {
  display: none;
}

/* Checkbox fields (e.g. Remember Me) — inline label + checkbox */
.auth-card form p:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.auth-card form p:has(input[type="checkbox"]) label {
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
}
.auth-card input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.auth-card input:focus {
  border-color: var(--primary);
}
.auth-card input::placeholder { color: var(--text-faint); }

/* Helptext under form fields (e.g. "Forgot your password?" link) */
.auth-card form .helptext {
  font-size: 12px;
  color: var(--text-faint);
}
.auth-card form .helptext a { color: var(--text-dim); }

/* Error lists within form fields */
.auth-card form ul.errorlist {
  list-style: none;
  font-size: 12px;
  color: var(--diff-del);
  padding: 0;
}
.auth-card form ul.errorlist li { margin-bottom: 2px; }

/* Buttons */
.auth-card button[type="submit"],
.auth-card .btn {
  width: 100%;
  padding: 11px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.auth-card button[type="submit"]:hover { background: var(--primary-hover); }

/* Social login (Google) */
.auth-card .socialaccount {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.auth-card .socialaccount h2,
.auth-card .socialaccount h3 {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
  font-weight: 500;
}
.auth-card .socialaccount ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-card .socialaccount li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s;
}
.auth-card .socialaccount li a:hover {
  border-color: var(--text-faint);
  text-decoration: none;
}

/* Logout page — simple confirm form, no field rows */
.auth-card form[action] {
  gap: 12px;
}
