:root {
  /* Overridden per-club inline in base.html — these are just a neutral
     fallback for pages that somehow render with no club resolved. */
  --club-primary: #0059A0;
  --club-secondary: #0C3C60;
}

body {
  font-family: system-ui, sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
  line-height: 1.5;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--club-primary);
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--club-secondary);
  text-decoration: none;
}

.club-logo {
  height: 32px;
  width: auto;
}

nav a {
  margin-left: 1rem;
  color: var(--club-secondary);
}

a {
  color: var(--club-primary);
}

button, input[type="submit"] {
  background: var(--club-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.flashes {
  list-style: none;
  padding: 0;
}

.flash-error {
  color: #b00020;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #ddd;
}

th {
  color: var(--club-secondary);
}

.role-choice {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.role-choice legend {
  color: var(--club-secondary);
  padding: 0 0.25rem;
}

.role-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0;
  cursor: pointer;
}

.role-name {
  font-weight: 600;
}

.role-description {
  grid-column: 2;
  font-size: 0.85em;
  color: #666;
}

.button {
  display: inline-block;
  background: var(--club-primary);
  color: #fff;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.button-secondary {
  background: #fff;
  color: var(--club-secondary);
  border: 1px solid #aaa;
}

.page-heading,
.profile-card-heading,
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.page-heading h1,
.profile-card h2 {
  margin-bottom: 0;
}

.page-heading p,
.profile-card-heading p {
  margin-top: 0.25rem;
  color: #555;
}

.profile-list {
  display: grid;
  gap: 1rem;
}

.profile-card,
.empty-state,
.profile-form fieldset,
.consent-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
}

.profile-details {
  display: grid;
  gap: 0.6rem;
}

.profile-details div {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2fr;
  gap: 0.75rem;
}

.profile-details dt {
  font-weight: 600;
  color: var(--club-secondary);
}

.profile-details dd {
  margin: 0;
}

.withdraw-form {
  margin-top: 1rem;
}

.withdrawn-profiles {
  margin-top: 1.5rem;
}

.withdrawn-profiles summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--club-secondary);
}

.form-intro {
  color: #444;
}

.profile-form {
  display: grid;
  gap: 1rem;
}

.profile-form fieldset {
  margin: 0;
}

.profile-form legend {
  color: var(--club-secondary);
  font-weight: 600;
  padding: 0 0.25rem;
}

.form-field {
  display: grid;
  gap: 0.25rem;
}

.form-field > label {
  color: var(--club-secondary);
  font-weight: 600;
}

.form-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.choice-list {
  display: grid;
  gap: 0.5rem;
}

.choice-list label,
.consent-box > label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  cursor: pointer;
}

.field-hint {
  display: block;
  color: #666;
  font-size: 0.9em;
}

.consent-box {
  background: #f6f8fa;
}

.form-actions {
  justify-content: flex-start;
}

.config-panel {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

.config-panel h2 {
  color: var(--club-secondary);
  margin-top: 0;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inline-form .form-field {
  flex: 1 1 14rem;
}

.table-scroll {
  overflow-x: auto;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.85em;
  font-weight: 600;
}

.status-active,
.status-accepted {
  background: #e4f4e8;
  color: #17652b;
}

.status-inactive,
.status-expired,
.status-superseded {
  background: #eee;
  color: #555;
}

.status-pending {
  background: #fff3cd;
  color: #745500;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-details div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
  }

  nav a {
    margin-left: 0;
  }

  .inline-form,
  .inline-form button {
    width: 100%;
  }
}
