/* Phases 2-3: one-time flash messages, header account actions and account forms.
   Self-contained on purpose: nothing here relies on form rules from app.css or components.css. */
.flash-wrap { padding-top: 24px; }
.flash { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px 20px; border: 1px solid; font-size: 16px; line-height: 1.5; }
.flash > .tl-icon { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.flash--ok { color: #166534; background: #eaf8ef; border-color: #b7e4c7; }
.flash--ok > .tl-icon { color: #16a34a; }
.flash--info { color: #000; background: #eaf0ff; border-color: #c7d5fb; }
.flash--info > .tl-icon { color: var(--tl-blue, #2b5fe3); }
.flash--error { color: #991b1b; background: #fdeded; border-color: #f5c2c2; }
.flash--error > .tl-icon { color: #dc2626; }

.auth-nav { display: flex; align-items: center; gap: 4px; }
.auth-nav-form { display: flex; margin: 0; }
.auth-nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border: 0; border-radius: 4px; background: none; color: #000; font: inherit; font-size: 14px; line-height: 20px; white-space: nowrap; cursor: pointer; }
.auth-nav-link:hover { color: var(--tl-blue, #2b5fe3); }
.auth-nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

.auth-layout { min-height: 0; }
.auth-panel { align-items: stretch; justify-content: flex-start; }
.auth-panel-body { width: 100%; max-width: 480px; }
.auth-lead { margin-top: 16px; font-size: 16px; line-height: 1.6; color: var(--tl-muted, #525252); }
.auth-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 24px; padding: 16px; background: #eaf0ff; font-size: 14px; line-height: 1.6; }
.auth-note > .tl-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--tl-blue, #2b5fe3); }
.auth-note a, .auth-foot a, .auth-errors a { text-decoration: underline; text-underline-offset: 3px; }
/* In-sentence links: 44px touch target without changing the line box */
.auth-note a, .auth-foot a { display: inline-block; padding-block: 12px; margin-block: -12px; }
.auth-note a { font-weight: 500; }
.auth-note a:hover, .auth-foot a:hover { color: var(--tl-blue, #2b5fe3); }

.auth-errors { margin-top: 24px; padding: 16px 20px; border: 1px solid #dc2626; background: #fdeded; color: #991b1b; font-size: 14px; line-height: 1.6; }
.auth-errors > p { display: flex; align-items: flex-start; gap: 12px; }
.auth-errors > p > .tl-icon { width: 20px; height: 20px; flex-shrink: 0; color: #dc2626; }
.auth-errors strong { font-weight: 500; }
.auth-errors ul { margin: 4px 0 0; padding-left: 52px; list-style: disc; }
.auth-errors a { display: block; padding-block: 10px; color: inherit; }

.auth-form { display: grid; gap: 20px; margin-top: 32px; }
.auth-field { display: grid; min-width: 0; }
.auth-field > label { margin-bottom: 8px; font-size: 14px; line-height: 20px; font-weight: 500; }
.auth-field .field__control { display: block; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 12px 14px; border: 1px solid var(--tl-control, #737373); border-radius: 4px; color: #000; background: #fff; font: inherit; font-size: 16px; line-height: 1.5; }
.auth-field .field__control:hover { border-color: #000; }
.auth-field .field__control:focus-visible { border-color: var(--tl-blue, #2b5fe3); outline: 3px solid var(--tl-blue, #2b5fe3); outline-offset: 3px; }
.auth-field .field__control[aria-invalid="true"] { border-color: #dc2626; }
.auth-field .field__control::placeholder { color: #737373; opacity: 1; }
.auth-field select.field__control { cursor: pointer; }
.auth-field .field-help { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--tl-muted, #525252); }
.auth-field .field__error { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: #991b1b; }
.auth-optional { font-weight: 400; color: var(--tl-muted, #525252); }
.auth-password { position: relative; }
.auth-password .field__control { padding-right: 52px; }
.auth-password-toggle { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--tl-muted, #525252); cursor: pointer; }
.auth-password-toggle:hover { color: #000; background: var(--tl-panel, #f5f5f5); }
.auth-password-toggle[aria-pressed="true"] { color: var(--tl-blue, #2b5fe3); }
.auth-submit { width: 100%; min-height: 52px; margin-top: 8px; white-space: normal; }
.auth-submit[aria-busy="true"] { cursor: wait; }
.auth-submit[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-busy .7s linear infinite; }
@keyframes auth-busy { to { transform: rotate(360deg); } }

.auth-foot { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--tl-line, #e5e5e5); font-size: 14px; line-height: 1.6; color: var(--tl-muted, #525252); }
.auth-foot p + p { margin-top: 8px; }
.auth-foot a { color: #000; font-weight: 500; }

@media (max-width: 720px) {
  .flash-wrap { padding-top: 16px; }
  .flash { padding: 14px 16px; }
  .auth-errors ul { padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-submit[aria-busy="true"]::before { animation: none; }
}
