/*
 * notiduck auth pages (R9 / 4.1c): sign in, create account, reset, set
 * password. Handwritten, no framework, no build step; CSP style-src 'self'
 * (no inline styles). Palette: stone + duckie #F6A600, text contrast at
 * WCAG AA or better on the stone-800 page.
 */

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

.auth-body {
  min-height: 100vh;
  background-color: #292524;
  color: #e7e5e4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.auth-main {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 3rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-logo {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
}
.auth-logo:focus-visible { outline: 2px solid #F6A600; outline-offset: 4px; }
.auth-logo-img { height: 2rem; width: auto; }
.auth-wordmark { color: #fafaf9; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }

.auth-heading { text-align: center; }
.auth-title {
  color: #fafaf9;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.auth-subtitle { color: #d6d3d1; font-size: 1rem; margin-top: 0.375rem; }
.auth-subtitle strong { color: #fafaf9; font-weight: 600; word-break: break-all; }

.auth-card {
  background-color: #1c1917;
  border: 1px solid #44403c;
  border-radius: 1rem;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.45);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 480px) { .auth-card { padding: 2rem; } }

.auth-text { color: #e7e5e4; font-size: 0.95rem; }
.auth-text strong { color: #fafaf9; word-break: break-all; }
.auth-fineprint { color: #a8a29e; font-size: 0.8125rem; text-align: center; }
.auth-fineprint a, .auth-text a { color: #F6A600; }

.auth-alert {
  border-radius: 0.625rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.auth-alert-notice { background-color: rgba(246, 166, 0, 0.1); border: 1px solid rgba(246, 166, 0, 0.4); color: #fde68a; }
.auth-alert-error { background-color: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.45); color: #fecaca; }

/* ── Form ─────────────────────────────────────────────────────────────── */

.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-label { color: #e7e5e4; font-size: 0.875rem; font-weight: 600; }
.label-link { color: #d6d3d1; font-size: 0.8125rem; text-decoration: none; }
.label-link:hover { color: #F6A600; text-decoration: underline; }
.field-link { align-self: flex-end; }
.field-hint { color: #a8a29e; font-size: 0.8125rem; }

.auth-input {
  width: 100%;
  background-color: #292524;
  color: #fafaf9;
  border: 1px solid #78716c;
  border-radius: 0.625rem;
  padding: 0.75rem 0.875rem;
  font: inherit;
  font-size: 1rem; /* 16px: iOS does not zoom into the field */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder { color: #a8a29e; }
.auth-input:hover { border-color: #a8a29e; }
.auth-input:focus { outline: none; border-color: #F6A600; box-shadow: 0 0 0 3px rgba(246, 166, 0, 0.25); }

.password-wrap { position: relative; }
.auth-input-password { padding-right: 3rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #d6d3d1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover { color: #F6A600; background: rgba(255, 255, 255, 0.05); }
.password-toggle:focus-visible { outline: 2px solid #F6A600; outline-offset: 1px; }
.password-toggle::before {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.password-toggle[aria-pressed="true"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.24A9 9 0 0 1 12 4c6.4 0 10 8 10 8a18 18 0 0 1-2.16 3.19'/%3E%3Cpath d='M6.6 6.6A18 18 0 0 0 2 12s3.6 8 10 8a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M14.1 14.1a3 3 0 1 1-4.2-4.2'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.check { display: flex; align-items: flex-start; gap: 0.625rem; color: #d6d3d1; font-size: 0.875rem; line-height: 1.45; cursor: pointer; }
.check input { flex-shrink: 0; width: 1.05rem; height: 1.05rem; margin-top: 0.12rem; accent-color: #F6A600; cursor: pointer; }
.check a { color: #F6A600; }

/* Honeypot (and the password-manager username twin): off-screen, not
   display:none, which some bots detect. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 0.75rem;
  background-color: #F6A600;
  color: #1c1917;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(246, 166, 0, 0.45);
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn-submit:hover { background-color: #fbbf24; }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible { outline: 2px solid #fafaf9; outline-offset: 2px; }
.btn-submit[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.btn-submit[aria-busy="true"]::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(28, 25, 23, 0.3);
  border-top-color: #1c1917;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.cap-status { color: #a8a29e; font-size: 0.8125rem; text-align: center; min-height: 0; }
.cap-status:empty { display: none; }
.cap-status.is-error { color: #fca5a5; }

/* Cap's instrumentation iframe: cap.js hides it with an inline style, which
   CSP style-src 'self' drops, so it is hidden here instead. */
iframe[sandbox="allow-scripts"][aria-hidden="true"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── "or" + Google ────────────────────────────────────────────────────── */

.auth-divider { display: flex; align-items: center; gap: 0.75rem; color: #a8a29e; font-size: 0.8125rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid #44403c; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3rem;
  border: 1px solid #d6d3d1;
  border-radius: 0.75rem;
  background-color: #ffffff;
  color: #1f1f1f;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-google:hover { background-color: #f5f5f4; }
.btn-google:focus-visible { outline: 2px solid #F6A600; outline-offset: 2px; }
.google-mark { width: 1.25rem; height: 1.25rem; }

/* ── Below the card ───────────────────────────────────────── */

.auth-switch { text-align: center; color: #d6d3d1; font-size: 0.9rem; }
.auth-switch a { color: #F6A600; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 768px) {
  .auth-main { max-width: 32rem; gap: 1.75rem; padding-top: 4rem; }
  .auth-logo-img { height: 2.5rem; }
  .auth-wordmark { font-size: 2.125rem; }
  .auth-title { font-size: 2.5rem; }
  .auth-subtitle { font-size: 1.125rem; margin-top: 0.5rem; }
  .auth-card { padding: 2.5rem 2.75rem; gap: 1.25rem; border-radius: 1.25rem; }
  .auth-form { gap: 1.375rem; }
  .auth-label { font-size: 0.95rem; }
  .auth-input { padding: 0.95rem 1.05rem; font-size: 1.0625rem; }
  .auth-input-password { padding-right: 3.25rem; }
  .btn-submit, .btn-google { min-height: 3.5rem; font-size: 1.0625rem; }
  .check { font-size: 0.95rem; }
  .auth-text { font-size: 1.025rem; }
  .auth-switch { font-size: 1rem; }
  .label-link { font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-submit, .auth-input, .btn-google { transition: none; }
  .btn-submit[aria-busy="true"]::before { animation-duration: 2s; }
}
