/* First Nations Employment auth pages (sign in, sign up, forgot, reset). Restyles the EXISTING form markup
   (views/auth/_field, _password, _form-errors and the page templates) with the fn tokens; the shell itself is Tailwind
   (views/auth/_head.ejs). Everything is scoped to .fn-auth so the account settings page keeps /css/auth.css. */

.fn-auth { --fa-gap: 1.1rem; }
.fn-auth .form { display: grid; gap: var(--fa-gap); }

/* Fields */
.fn-auth .field { display: grid; gap: .4rem; margin: 0; }
.fn-auth .field[hidden] { display: none; }
.fn-auth .field label, .fn-auth .split label { font: 600 14px/1.3 var(--fn-font-body); color: var(--fn-ink); }
.fn-auth .req { color: var(--fn-ink-2); font-weight: 500; }
.fn-auth .muted.small { color: var(--fn-ink-2); font-weight: 400; }
.fn-auth .input {
  width: 100%; min-height: 48px; padding: .7rem .9rem; margin: 0;
  font: 400 16px/1.4 var(--fn-font-body); color: var(--fn-ink);
  background: var(--fn-raised); border: 1px solid var(--fn-line-strong); border-radius: var(--fn-radius);
  box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.fn-auth select.input { cursor: pointer; }
.fn-auth .input::placeholder { color: var(--fn-ink-2); opacity: .8; }
.fn-auth .input:hover { border-color: var(--fn-ink-2); }
.fn-auth .input:focus, .fn-auth .input:focus-visible { outline: none; border-color: var(--fn-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fn-ink) 18%, transparent); }
.fn-auth .input[aria-invalid="true"] { border-color: var(--fn-accent); border-width: 2px; padding: calc(.7rem - 1px) calc(.9rem - 1px); }
.fn-auth .hint { font-size: 13px; line-height: 1.45; color: var(--fn-ink-2); }
/* Errors: text + a marker, never colour alone. */
.fn-auth .error { display: flex; align-items: flex-start; gap: .4rem; font: 600 13px/1.45 var(--fn-font-body); color: var(--fn-ink); }
.fn-auth .error::before { content: "!"; flex: none; display: grid; place-items: center; width: 17px; height: 17px; margin-top: 1px; border-radius: 50%; background: var(--fn-accent); color: var(--fn-raised); font-size: 11px; font-weight: 800; }
.fn-auth .error[hidden] { display: none; }

/* Password with show/hide */
.fn-auth .pw { position: relative; }
.fn-auth .pw .input { padding-right: 4.75rem; }
.fn-auth .pw__toggle {
  position: absolute; top: 50%; right: .4rem; transform: translateY(-50%);
  min-width: 44px; min-height: 36px; padding: 0 .75rem; border: 0; border-radius: var(--fn-radius-sm);
  background: transparent; color: var(--fn-ink); font: 600 14px/1 var(--fn-font-body); cursor: pointer;
}
.fn-auth .pw__toggle:hover { background: var(--fn-surface); }
.fn-auth .split { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

/* Rows */
.fn-auth .form-row { display: grid; gap: var(--fa-gap); }
@media (min-width: 640px) {
  .fn-auth .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fn-auth .form-row--3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, .9fr); }
  .fn-auth .form-row--street { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

/* Checkboxes */
.fn-auth .check { display: flex; align-items: flex-start; gap: .7rem; font-size: 15px; line-height: 1.45; color: var(--fn-ink); cursor: pointer; }
.fn-auth .check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--fn-ink); cursor: pointer; }
.fn-auth .check--error { padding: .75rem; border: 2px solid var(--fn-accent); border-radius: var(--fn-radius); }

/* Section headings inside long forms */
.fn-auth .auth__section { margin: 1rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--fn-line); font: 700 17px/1.3 var(--fn-font-display); letter-spacing: -.01em; color: var(--fn-ink); }
.fn-auth .form > .auth__section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.fn-auth .auth__section-note, .fn-auth .auth__note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fn-ink-2); }

/* Buttons (existing kds classes, fn look) */
.fn-auth .form-actions { margin-top: .35rem; }
.fn-auth .kds-btn--accent {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 50px;
  padding: .8rem 1.25rem; border: 0; border-radius: var(--fn-radius); background-color: var(--fn-accent); color: var(--fn-on-accent);
  font: 600 16px/1 var(--fn-font-body); cursor: pointer; transition: background-color .15s ease, transform .1s ease; box-shadow: none;
}
/* Hover: the Copper → Forest gradient moves toward green (fn-home.css). */
.fn-auth .kds-btn--accent:active { transform: translateY(1px); }
.fn-auth .kds-btn--accent[data-loading] { pointer-events: none; opacity: .85; }
.fn-auth .kds-btn--accent[data-loading]::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fn-auth-spin .7s linear infinite; }
@keyframes fn-auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fn-auth .kds-btn--accent[data-loading]::before { animation: none; } }

/* Error summary and notices */
.fn-auth .auth-alert { margin-bottom: 1.25rem; padding: 1rem 1.1rem; border: 2px solid var(--fn-accent); border-radius: var(--fn-radius); background: var(--fn-raised); color: var(--fn-ink); font-size: 15px; line-height: 1.5; }
.fn-auth .auth-alert:focus { outline: 3px solid color-mix(in srgb, var(--fn-ink) 25%, transparent); outline-offset: 2px; }
.fn-auth .auth-alert p { margin: 0; }
.fn-auth .auth-alert p:first-child::before { content: "Error: "; font-weight: 700; }
.fn-auth .auth-alert ul { margin: .5rem 0 0; padding-left: 1.1rem; list-style: disc; }
.fn-auth .auth-alert a { color: var(--fn-ink); text-decoration: underline; text-underline-offset: 3px; }
.fn-auth .auth-info { padding: 1rem 1.1rem; border-radius: var(--fn-radius); background: var(--fn-surface); color: var(--fn-ink); font-size: 15px; line-height: 1.55; }
.fn-auth .auth-info strong { font-weight: 700; }
.fn-auth .auth-info p, .fn-auth .auth-info ol { margin: .4rem 0 0; }
.fn-auth .auth-info ol { padding-left: 1.2rem; list-style: decimal; }
.fn-auth .auth-info--ok { border: 1px solid var(--fn-line-strong); background: var(--fn-raised); }
.fn-auth .auth-info--ok > strong::before { content: "✓ "; }
.fn-auth .auth-info a, .fn-auth .check a, .fn-auth .auth-lead a, .fn-auth .auth-link { color: var(--fn-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--fn-line-strong); text-underline-offset: 3px; }
.fn-auth .auth-info a:hover, .fn-auth .check a:hover, .fn-auth .auth-lead a:hover, .fn-auth .auth-link:hover { text-decoration-color: var(--fn-ink); }
.fn-auth .small { font-size: 14px; }

/* Footer line under a form */
.fn-auth .auth__foot { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--fn-line); font-size: 15px; color: var(--fn-ink-2); }
.fn-auth .auth__foot a { color: var(--fn-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--fn-line-strong); text-underline-offset: 3px; }
.fn-auth .auth__foot a:hover { text-decoration-color: var(--fn-ink); }

/* Sign in: account-type hint (?role=) */
.fn-auth .role-hints { display: flex; gap: .25rem; margin-bottom: 1.25rem; padding: .25rem; border-radius: 0; background: var(--fn-surface); }
.fn-auth .role-hint { flex: 1; padding: .55rem .75rem; border-radius: 0; text-align: center; font: 600 14px/1.2 var(--fn-font-body); color: var(--fn-ink-2); text-decoration: none; }
.fn-auth .role-hint:hover { color: var(--fn-ink); }
.fn-auth .role-hint.is-active { background: var(--fn-raised); color: var(--fn-ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--fn-ink) 15%, transparent); }

/* Sign up: role choice */
.fn-auth .role-select { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.fn-auth .role-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem;
  border: 1px solid var(--fn-line); border-radius: var(--fn-radius-lg); background: var(--fn-raised); color: var(--fn-ink);
  text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
.fn-auth .role-opt::after { content: ""; flex: none; width: 10px; height: 10px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); margin-right: .25rem; }
.fn-auth .role-opt:hover { border-color: var(--fn-ink); transform: translateY(-1px); }
.fn-auth .role-opt__body { display: grid; gap: .2rem; min-width: 0; flex: 1; }
.fn-auth .role-opt__title { font: 700 18px/1.25 var(--fn-font-display); letter-spacing: -.01em; }
.fn-auth .role-opt__desc { font-size: 15px; line-height: 1.45; color: var(--fn-ink-2); }
.fn-auth .role-opt__meta { flex: none; padding: .25rem .6rem; border-radius: 0; background: var(--fn-surface); font-size: 12px; font-weight: 600; color: var(--fn-ink-2); white-space: nowrap; }


/* Overrides for base component styles that would otherwise show through. */
.fn-auth .check:not(.check--error) { padding: 0; border: 0; background: none; box-shadow: none; }
.fn-auth .kds-btn--accent:focus-visible, .fn-auth .role-opt:focus-visible, .fn-auth .role-hint:focus-visible, .fn-auth .pw__toggle:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--fn-canvas), 0 0 0 5px var(--fn-ink);
}
.fn-auth .role-opt__head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }

/* Contact form (shares these form styles): button above its note, textarea height. */
.fn-auth .form-actions:has(> span) { display: grid; gap: .6rem; }
.fn-auth .form-actions > span { font-size: 13px; color: var(--fn-ink-2); }
.fn-auth textarea.input { min-height: 160px; resize: vertical; }
