/* ── Lexington Group Membership Portal — Shared Styles ── */
/* Matches registration system: Playfair Display + Source Serif 4, red #c0281c */

:root {
  --red: #c0281c;
  --red-dark: #9e1f14;
  --red-light: #fdf0ee;
  --gray-1: #f5f5f5;
  --gray-2: #efefef;
  --gray-3: #ddd;
  --gray-4: #999;
  --gray-5: #555;
  --text: #1a1a1a;
  --white: #ffffff;
  --success: #1e7e44;
  --success-bg: #edf7f1;
  --header-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--gray-1);
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Site Header ── */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  height: var(--header-h);
}
.site-header img { height: 42px; width: auto; flex-shrink: 0; }
.site-header .org-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1.2;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.82rem;
}
.header-user {
  color: var(--gray-5);
  font-style: italic;
}
.header-nav a {
  color: var(--gray-5);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}
.header-nav a:hover { background: var(--gray-2); color: var(--text); }
.header-nav a.active { color: var(--red); font-weight: 600; }

/* ── Page wrapper ── */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 36px 24px 80px; }
.page-wrap.wide { max-width: 1060px; }

/* ── Page title ── */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.page-title-sub {
  font-family: 'Source Serif 4', serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--gray-4);
  font-style: italic;
}

/* ── Cards / Panels ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-3);
  border-radius: 4px;
  margin-bottom: 20px;
}
.card-header {
  background: var(--gray-1);
  border-bottom: 1px solid var(--gray-3);
  padding: 11px 20px;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 3px solid var(--red);
  border-radius: 4px 4px 0 0;
}
.card-body { padding: 20px 24px; }

/* ── Forms ── */
.form-section {
  background: var(--white);
  border: 1px solid var(--gray-3);
  border-radius: 4px;
  padding: 22px 26px;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--red);
}
.field-group { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 5px;
}
.field-label .req { color: var(--red); }
.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="tel"],
.field-group input[type="password"],
.field-group input[type="date"],
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-3);
  border-radius: 3px;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,40,28,0.09);
}
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field-row-addr { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 14px; }

/* ── Toggle / checkbox ── */
.check-option { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 6px; }
.check-option input { width: 16px; height: 16px; accent-color: var(--red); cursor: pointer; }
.clabel { font-size: 0.97rem; cursor: pointer; color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: 3px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  line-height: 1.4;
}
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--red); border: 1px solid var(--red); }
.btn-secondary:hover { background: var(--red-light); }
.btn-danger { background: white; color: #b91c1c; border: 1px solid #b91c1c; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 14px; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }

/* ── Alerts / Messages ── */
.alert {
  padding: 11px 16px;
  border-radius: 4px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-bg); border: 1px solid #a7d7bc; color: #155c31; }
.alert-error   { background: var(--red-light); border: 1px solid #e8b0aa; color: var(--red-dark); }
.alert-info    { background: #eef3ff; border: 1px solid #bfcfee; color: #2a3d8a; }

/* ── Member list table ── */
.member-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.member-table th {
  background: var(--gray-1);
  padding: 8px 14px;
  text-align: left;
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-5);
  font-weight: 600;
  border-bottom: 2px solid var(--red);
  white-space: nowrap;
}
.member-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-2);
  color: var(--gray-5);
  vertical-align: middle;
}
.member-table tr:last-child td { border-bottom: none; }
.member-table tr:hover td { background: var(--gray-1); }
.member-table a { color: var(--red); text-decoration: none; }
.member-table a:hover { text-decoration: underline; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-expired  { background: #fee2e2; color: #991b1b; }
.badge-inactive { background: var(--gray-2); color: var(--gray-4); }
.badge-donor    { background: #ede9fe; color: #5b21b6; }
.badge-benefactor { background: #fef3c7; color: #92400e; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--gray-3);
  border-radius: 3px;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--red); }
.search-count { font-size: 0.82rem; color: var(--gray-4); font-style: italic; white-space: nowrap; }

/* ── Profile view (read-only grid) ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}
.profile-field {}
.profile-field-label {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-4);
  font-weight: 600;
  margin-bottom: 2px;
}
.profile-field-value {
  font-size: 0.97rem;
  color: var(--text);
}
.profile-field-value.empty { color: var(--gray-4); font-style: italic; }

/* ── Expiry indicator ── */
.expiry-ok   { color: var(--success); font-weight: 600; }
.expiry-warn { color: #d97706; font-weight: 600; }
.expiry-past { color: var(--red); font-weight: 600; }

/* ── Footer ── */
footer {
  background: var(--gray-1);
  border-top: 1px solid var(--gray-3);
  padding: 16px 32px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--gray-4);
}
footer a { color: var(--red); text-decoration: none; }

/* ── Read-only field display ── */
.field-readonly {
  padding: 9px 0;
  font-size: 1rem;
  color: var(--gray-5);
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .page-wrap { padding: 24px 16px 60px; }
  .field-row, .field-row-3, .field-row-addr { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .header-user { display: none; }
  .site-header .org-name { display: none; }
  .hamburger { display: block; margin-left: auto; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px 8px; }
  .header-nav { display: none; position: absolute; top: 62px; right: 0; background: white; border: 1px solid var(--gray-3); border-radius: 4px; padding: 8px; z-index: 200; flex-direction: column; width: 160px; }
  .header-nav.nav-open { display: flex; }
  .member-table th:nth-child(n+3),
  .member-table td:nth-child(n+3) { display: none; }
  .member-table th:nth-child(n+4),
  .member-table td:nth-child(n+4) { display: none; }
}
@media (min-width: 641px) { .hamburger { display: none; } }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-warn { background: #fff3cd; color: #856404; }
.badge-info { background: #cfe2ff; color: #084298; }
.badge-ok   { background: #d1e7dd; color: #0a3622; }
.badge-err  { background: #f8d7da; color: #842029; }

/* ── Danger button ── */
.btn-danger {
  background: #c0281c;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #a02018; }
