/* Citizeo shared auth form. Used by /login.html (with hero) and the SPA's
   anonymous→permanent conversion modal (compact). All styles are scoped
   under .cz-af to avoid colliding with the SPA's global .btn / .divider /
   .toggle classes. */

.cz-af { box-sizing: border-box; }
.cz-af *, .cz-af *::before, .cz-af *::after { box-sizing: inherit; }

/* Layout shells.
   - .cz-af-split: side-by-side hero+card layout used by /login.html
   - .cz-af-compact: card-only layout used inside SPA modals */
.cz-af-split { display: flex; align-items: stretch; width: 100%; max-width: 760px; box-shadow: 0 2px 16px rgba(0,0,0,0.08); border-radius: 12px; overflow: hidden; background: var(--surface, #fff); }
.cz-af-split.no-video { max-width: 380px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 8px; }
.cz-af-split.no-video > .cz-af-card { max-width: 380px; border-radius: 8px; box-shadow: none; }
.cz-af-hero { position: relative; flex: 0 0 320px; background: #111; }
.cz-af-hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease-in-out; }
.cz-af-hero video.active { opacity: 1; }
.cz-af-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.35)); pointer-events: none; }
.cz-af-hero-credit { position: absolute; right: 0.5rem; bottom: 0.4rem; z-index: 1; color: rgba(255,255,255,0.42); font-size: 0.625rem; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.28); pointer-events: none; }

.cz-af-card { background: var(--surface, #fff); padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); width: 100%; max-width: 380px; }
.cz-af-split > .cz-af-card { flex: 1; max-width: none; border-radius: 0; box-shadow: none; }

/* Compact layout (inside SPA modal) — no shell, no logo, no hero. */
.cz-af-compact .cz-af-card { padding: 0; box-shadow: none; max-width: none; background: transparent; }

/* Logo + tagline (page-only). */
.cz-af-logo { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.cz-af-logo img { width: 28px; height: 28px; }
.cz-af-logo span { font-family: 'Merriweather Sans', sans-serif; font-weight: 600; font-size: 1.25rem; }
.cz-af-title { font-size: 0.875rem; font-weight: 400; margin-bottom: 1.25rem; color: var(--text-subtle, #8686a0); text-align: center; }

/* Form inputs — DM Sans, light border, 4px corners. Scoped to descendants
   of <form> inside the auth card so other labels/inputs that callers
   render alongside (e.g. a merge picker with its own radio labels) don't
   inherit the block-display + bottom-margin treatment. */
.cz-af form label { display: block; font-size: 0.8125rem; color: var(--text-muted, #56586a); margin-bottom: 0.25rem; }
.cz-af form input[type="email"], .cz-af form input[type="password"] { width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--border, #d9d3c7); border-radius: 4px; font-size: 0.9375rem; font-family: inherit; margin-bottom: 0.875rem; background: var(--surface, #fff); color: var(--text, #1f2338); }
.cz-af form input:focus { outline: none; border-color: var(--brand-primary, #4a7c59); }

/* Pill buttons. */
.cz-af-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border: 1px solid var(--border, #d9d3c7); border-radius: 999px; background: var(--surface, #fff); color: var(--text, #1f2338); font-size: 0.9375rem; font-family: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.cz-af-btn:hover { border-color: var(--brand-primary, #4a7c59); }
.cz-af-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.cz-af-btn.primary { background: var(--brand-primary, #4a7c59); color: #fff; border-color: var(--brand-primary, #4a7c59); }
.cz-af-btn.primary:hover { background: var(--brand-primary-hover, #3b6548); border-color: var(--brand-primary-hover, #3b6548); }
.cz-af-btn img, .cz-af-btn svg { width: 18px; height: 18px; }
.cz-af-btn + .cz-af-btn { margin-top: 0.5rem; }
.cz-af form > .cz-af-btn { margin-top: 0.25rem; }

/* "or" divider. */
.cz-af-divider { display: flex; align-items: center; gap: 0.625rem; margin: 1rem 0; color: var(--text-subtle, #8686a0); font-size: 0.75rem; }
.cz-af-divider::before, .cz-af-divider::after { content: ""; flex: 1; height: 1px; background: var(--border, #d9d3c7); }

/* Toggle (signin↔signup) and forgot row. */
.cz-af-toggle { text-align: center; margin-top: 1rem; font-size: 0.8125rem; color: var(--text-muted, #56586a); }
.cz-af-toggle a { color: var(--brand-primary, #4a7c59); cursor: pointer; text-decoration: underline; }
.cz-af-form-row { display: flex; align-items: center; justify-content: flex-end; margin: -0.25rem 0 0.875rem; }
.cz-af-link-btn { background: none; border: none; padding: 0; color: var(--brand-primary, #4a7c59); font: inherit; font-size: 0.8125rem; cursor: pointer; text-decoration: underline; }

/* Status messages. */
.cz-af-error { color: #b84242; font-size: 0.8125rem; margin-top: 0.75rem; text-align: center; }
.cz-af-success { color: #2d6a3f; font-size: 0.875rem; margin-top: 0.875rem; text-align: center; }
.cz-af-loading { color: var(--text-muted, #56586a); font-size: 0.8125rem; margin-top: 0.75rem; text-align: center; }
.cz-af [hidden] { display: none !important; }

/* Reset panel — only used by the full login page. */
.cz-af-reset { display: none; }

@media (max-width: 720px) {
  .cz-af-hero { display: none; }
  .cz-af-split { max-width: 380px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
  .cz-af-split > .cz-af-card { max-width: 380px; }
}
@media (max-width: 480px) {
  .cz-af-split { max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; background: transparent; }
  .cz-af-card { max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; padding: 1.5rem; display: flex; flex-direction: column; justify-content: center; }
  .cz-af-split > .cz-af-card { min-height: 100vh; }
  .cz-af-compact .cz-af-card { min-height: 0; padding: 0; }
  .cz-af-logo { margin-bottom: 1rem; }
  .cz-af-title { margin-bottom: 1rem; }
  .cz-af input[type="email"], .cz-af input[type="password"] { margin-bottom: 0.625rem; }
  .cz-af-divider { margin: 0.75rem 0; }
  .cz-af-btn + .cz-af-btn { margin-top: 0.375rem; }
  .cz-af-toggle { margin-top: 0.75rem; }
}
