/* Accounts pages: log in, registration, passwords, profile and user management. */

/* Log-in / registration pages: a quiet background so the form card stands out. */
.auth-page { background-color: var(--bs-tertiary-bg); }
.auth-page .app-footer { background: transparent; }
/* Logo, name and tagline above the card (accounts/_brand.html). */
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-logo { display: block; width: 4rem; height: 4rem; margin: 0 auto .5rem; }
.auth-brand-name { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--bs-emphasis-color); }
.auth-brand-tagline { display: block; margin-top: .15rem; font-size: 1rem; font-weight: 400; color: var(--bs-secondary-color); }
/* Inside the card: optional icon, the page heading and one line under it. */
.auth-icon { margin-bottom: .75rem; font-size: 3rem; line-height: 1; text-align: center; }
.auth-title { margin-bottom: 1rem; font-size: 1.35rem; font-weight: 600; text-align: center; }
.auth-lead { margin: -.5rem 0 1rem; text-align: center; color: var(--bs-secondary-color); }
.auth-card .card-body { padding: 1.25rem; }
@media (min-width: 576px) {
  .auth-card .card-body { padding: 1.75rem; }
}
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Honeypot input: off-screen and hidden from assistive technology (aria-hidden wrapper). */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Password inputs with a show/hide button. */
.password-toggle { min-width: 44px; }

/* Sections inside one form card. */
.form-section + .form-section { border-top: 1px solid var(--bs-border-color); margin-top: .5rem; padding-top: 1.25rem; }
.form-section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; }

/* Touch screens: tap targets of at least 44 px (checkboxes, tabs, breadcrumbs, inline links). */
@media (pointer: coarse) {
  .form-check { display: flex; flex-wrap: wrap; align-items: center; column-gap: .6rem; min-height: 44px; padding-left: 0; }
  .form-check .form-check-input { float: none; flex: none; width: 1.4rem; height: 1.4rem; margin: 0; }
  .form-check .form-check-label { flex: 1 1 0; padding: .45rem 0; }
  .form-check .form-text, .form-check .invalid-feedback { flex-basis: 100%; margin-top: 0; }
  .user-tabs .nav-link { min-height: 44px; display: inline-flex; align-items: center; }
  .breadcrumb-item a, .tap-target { display: inline-flex; align-items: center; min-height: 44px; }
  .breadcrumb { align-items: center; }
  /* Centre the "/" separator next to a 44 px link (Bootstrap floats it to the top). */
  .breadcrumb-item { display: flex; align-items: center; }
  .breadcrumb-item + .breadcrumb-item::before { float: none; }
  .user-table .btn-sm { min-height: 44px; display: inline-flex; align-items: center; }
  /* Links styled as buttons: centre their text vertically like <button>s once min-height applies. */
  main a.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
}

/* What people wrote when registering: keep their line breaks, never overflow. */
.user-note { white-space: pre-line; overflow-wrap: anywhere; border-left: 3px solid var(--bs-border-color); padding: .15rem 0 .15rem .75rem; margin: 0; }
.user-table .user-note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 40rem; }
.min-w-0 { min-width: 0; }

/* User list. */
.user-tabs { gap: .25rem; --bs-nav-pills-link-active-bg: #1f4e79; }
[data-bs-theme="dark"] .user-tabs { --bs-nav-pills-link-active-bg: #2f6fa8; }
.user-tabs .nav-link { padding: .4rem .8rem; }
.user-tabs .badge { font-weight: 600; }
.user-table th { white-space: nowrap; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); font-weight: 600; }
.user-table td.actions { white-space: nowrap; text-align: end; }
.user-card .card-body, .list-card .card-body { display: flex; flex-direction: column; gap: .6rem; }
.user-card dl, .list-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .75rem; margin: 0; }
.user-card dt, .list-card dt { font-weight: 500; color: var(--bs-secondary-color); }
.user-card dd, .list-card dd { margin: 0; overflow-wrap: anywhere; }
.user-card .user-actions, .list-card-actions { margin-top: auto; }
.list-card-actions .btn { width: 100%; }
.user-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.user-actions form { margin: 0; }
.user-card .user-actions > * { flex: 1 1 auto; }
.user-card .user-actions .btn { width: 100%; }

/* Definition lists on the profile and user detail pages. */
.info-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem 1rem; margin: 0; }
.info-list dt { font-weight: 500; color: var(--bs-secondary-color); font-size: .875rem; }
.info-list dd { margin: 0 0 .6rem; overflow-wrap: anywhere; }
@media (min-width: 576px) {
  .info-list { grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); }
  .info-list dd { margin-bottom: .4rem; }
}

/* Account status card and action list on the user detail page. */
.status-actions { display: grid; gap: .5rem; }
.status-actions form { margin: 0; }
.status-actions .btn { width: 100%; }
.danger-zone { border-top: 1px solid var(--bs-border-color); padding-top: 1rem; margin-top: .5rem; }

/* Tool roles. */
.role-list { list-style: none; padding: 0; margin: 0; }
.role-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; padding: .55rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.role-list li:last-child { border-bottom: 0; }
.role-list a { overflow-wrap: anywhere; }

/* Booking numbers. */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 576px) {
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-tile { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .75rem; }
.stat-tile .value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.stat-tile .label { font-size: .8rem; color: var(--bs-secondary-color); }

/* History timeline. */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; }
.timeline li::before { content: ""; position: absolute; left: .3rem; top: .45rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--bs-secondary-color); }
.timeline li::after { content: ""; position: absolute; left: .575rem; top: 1.2rem; bottom: .1rem; width: 1px; background: var(--bs-border-color); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .8rem; color: var(--bs-secondary-color); }

/* Role badges with AA contrast in both colour themes. */
.badge-role { background-color: #1f4e79; color: #fff; }
[data-bs-theme="dark"] .badge-role { background-color: #2f6fa8; }
.badge-tech { background-color: var(--bs-secondary-bg); color: var(--bs-emphasis-color); border: 1px solid var(--bs-border-color); }

/* User-group choices: "I am a…" at registration and the admins' user group checkboxes.
   Each option is a bordered row whose whole area (at least 44 px high) toggles it. */
.choice-fieldset legend { font-size: 1rem; margin-bottom: .25rem; }
.choice-list { display: grid; gap: .5rem; }
.choice-list .form-check { position: relative; display: block; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--bs-border-color); border-radius: .5rem; background-color: var(--bs-body-bg); }
.choice-list .form-check .form-check-input { position: absolute; left: .85rem; top: .8rem; float: none; width: 1.25rem; height: 1.25rem; margin: 0; }
.choice-list .form-check .form-check-label { display: block; min-height: 44px; padding: .65rem .85rem .65rem 2.6rem; cursor: pointer; }
.choice-list .form-check:has(.form-check-input:checked) { border-color: var(--bs-primary); background-color: rgba(var(--bs-primary-rgb), .08); }
.choice-list .form-check:has(.is-invalid) { border-color: var(--bs-form-invalid-border-color); }
.choice-name { display: block; font-weight: 500; }
.choice-description { display: block; font-size: .875rem; color: var(--bs-secondary-color); }

/* User group names (badges) with AA contrast in both colour themes. */
.badge-group { background-color: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); border: 1px solid var(--bs-info-border-subtle); font-weight: 500; white-space: normal; text-align: start; }
