:root {
  --member-wine: #6f2027;
  --member-wine-dark: #4f171d;
  --member-sand: #e9ad58;
  --member-cream: #fffaf3;
  --member-ink: #35281f;
  --member-muted: #765f4e;
  --member-line: rgba(111, 32, 39, 0.12);
}

.member-page,
.legal-page {
  min-height: 70vh;
  color: var(--member-ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(233, 173, 88, 0.12), transparent 28rem),
    linear-gradient(180deg, #fffdf9 0%, #fbf5ed 100%);
}

.member-hero,
.legal-hero {
  padding: 5rem 1rem 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--member-line);
  background: linear-gradient(135deg, rgba(255, 249, 241, 0.96), rgba(246, 231, 214, 0.86));
}

.member-eyebrow,
.legal-eyebrow,
.profile-section-heading span {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: #9b6333;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.member-hero h1,
.legal-hero h1 {
  margin: 0;
  color: var(--member-wine-dark);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
}

.member-hero p,
.legal-hero p {
  max-width: 760px;
  margin: 1rem auto 0;
  color: var(--member-muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.member-shell,
.legal-shell {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

/* Match the main navbar container and its responsive outer gutters. */
.legal-page .legal-shell {
  width: calc(100% - 112px);
  max-width: 1380px;
}

@media (max-width: 900px) {
  .legal-page .legal-shell {
    width: calc(100% - 40px);
  }
}

.member-alert {
  margin-bottom: 1.5rem;
  border: 0;
  border-inline-start: 4px solid currentColor;
  border-radius: 0.3333rem;
}

.profile-summary-card,
.profile-form-card,
.profile-booking-card,
.profile-empty-state,
.legal-card,
.legal-toc {
  border: 1px solid var(--member-line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(78, 52, 29, 0.09);
}

.profile-summary-card,
.profile-form-card {
  border-radius: 0.5833rem;
  padding: 2rem;
}

.profile-summary-card {
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 auto 1.25rem;
  place-items: center;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--member-wine), #b16a3b);
  box-shadow: 0 16px 40px rgba(111, 32, 39, 0.22);
  font-size: 2.5rem;
  font-weight: 800;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary-card h2,
.profile-form-card h2,
.profile-section-heading h2 {
  margin: 0;
  color: var(--member-wine-dark);
  font-weight: 800;
}

.profile-summary-card > p {
  margin: 0.45rem 0 1.5rem;
  color: var(--member-muted);
  overflow-wrap: anywhere;
}

.profile-provider,
.profile-member-since {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--member-line);
  color: var(--member-muted);
  text-align: start;
}

.profile-provider strong,
.profile-member-since strong {
  color: var(--member-ink);
}

.profile-form-card h2 {
  margin-bottom: 1.5rem;
}

.profile-form-card .form-label {
  color: #6c5040;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.profile-form-card .form-control {
  min-height: 52px;
  border-color: rgba(111, 32, 39, 0.14);
  border-radius: 0.3333rem;
  background: #fffdf9;
  color: var(--member-ink);
}

.profile-form-card .form-control:focus {
  border-color: #c88b4b;
  box-shadow: 0 0 0 0.22rem rgba(200, 139, 75, 0.14);
}

.profile-form-card .form-control[readonly] {
  background: #f3eee8;
}

.profile-save-btn,
.profile-outline-btn {
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 800;
}

.profile-save-btn {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--member-wine), #9b4e35);
  box-shadow: 0 12px 28px rgba(111, 32, 39, 0.2);
}

.profile-save-btn:hover,
.profile-save-btn:focus {
  color: #fff;
  transform: translateY(-1px);
}

.profile-outline-btn {
  border: 1px solid rgba(111, 32, 39, 0.2);
  color: var(--member-wine);
  background: #fff;
}

.profile-bookings-section {
  margin-top: 3rem;
}

.profile-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-section-heading span {
  margin-bottom: 0.35rem;
}

.profile-booking-card {
  height: 100%;
  padding: 1.4rem;
  border-radius: 0.4667rem;
}

.booking-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--member-muted);
  font-size: 0.82rem;
}

.booking-status {
  display: inline-flex;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
}

.status-pending { color: #7a5415; background: #fff0c9; }
.status-confirmed { color: #23613d; background: #dff3e8; }
.status-cancelled { color: #8b3038; background: #f9dfe2; }

.profile-booking-card h3 {
  margin: 1.1rem 0;
  color: var(--member-wine-dark);
  font-size: 1.25rem;
  font-weight: 800;
}

.profile-booking-card dl,
.profile-booking-card dd {
  margin: 0;
}

.profile-booking-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--member-line);
}

.profile-booking-card dt { color: var(--member-muted); font-weight: 600; }
.profile-booking-card dd { color: var(--member-ink); font-weight: 700; text-align: end; }

.profile-empty-state {
  padding: 3.5rem 1.5rem;
  border-radius: 0.5833rem;
  text-align: center;
}

.profile-empty-state > div {
  color: var(--member-sand);
  font-size: 3rem;
}

.profile-empty-state p {
  margin: 0.5rem 0 1.25rem;
  color: var(--member-muted);
}

.auth-legal-note {
  margin: 1rem 0 0;
  color: #7a6555;
  font-size: 0.78rem;
  line-height: 1.65;
  text-align: center;
}

.auth-legal-note a { color: var(--member-wine); font-weight: 700; }

.legal-updated {
  display: inline-flex;
  margin-top: 1.25rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--member-line);
  border-radius: 999px;
  color: var(--member-muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem;
  border-radius: 0.4667rem;
}

.legal-toc strong {
  flex-basis: 100%;
  margin-bottom: 0.55rem;
  color: var(--member-wine-dark);
}

.legal-toc a {
  padding: 0.55rem 0.65rem;
  border-radius: 0.25rem;
  color: var(--member-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.legal-toc a:hover,
.legal-toc a:focus {
  color: var(--member-wine);
  background: rgba(111, 32, 39, 0.06);
}

.legal-card {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 0.6667rem;
}

.legal-section {
  position: relative;
  padding: 0 0 2.25rem;
  scroll-margin-top: 120px;
}

.legal-section + .legal-section {
  padding-top: 2.25rem;
  border-top: 1px solid var(--member-line);
}

.legal-section-number {
  display: inline-flex;
  margin-bottom: 0.6rem;
  color: #ad7440;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.legal-section h2,
.legal-sources h2 {
  margin: 0 0 1rem;
  color: var(--member-wine-dark);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 800;
}

.legal-section p,
.legal-section li,
.legal-sources li {
  color: #5e4c3f;
  line-height: 1.9;
}

.legal-section ul,
.legal-sources ul {
  margin-bottom: 0;
  padding-inline-start: 1.35rem;
}

.legal-section li + li,
.legal-sources li + li { margin-top: 0.55rem; }

.legal-sources {
  padding: 1.5rem;
  border-radius: 0.4167rem;
  background: #fbf2e7;
}

.legal-sources a { color: var(--member-wine); font-weight: 700; }

@media (max-width: 575.98px) {
  .member-hero,
  .legal-hero { padding-top: 3.5rem; }
  .profile-summary-card,
  .profile-form-card,
  .legal-card { padding: 1.35rem; border-radius: 0.45rem; }
  .profile-section-heading { align-items: stretch; flex-direction: column; }
  .profile-section-heading .btn { width: 100%; }
  .profile-booking-card dl > div { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .profile-booking-card dd { text-align: start; }
}
