:root {
  --auth-coral: #ff6f61;
  --auth-coral-deep: #c9674a;
  --auth-canvas: #faf7f2;
  --auth-text: #25211d;
  --auth-muted: #756b61;
  --auth-line: #eadccc;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sign-in-button,
.auth-user {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 111, 97, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--auth-text);
  box-shadow: 0 10px 28px rgba(34, 34, 34, 0.08);
  font: inherit;
  font-weight: 800;
}

.sign-in-button {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.sign-in-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 111, 97, 0.55);
  box-shadow: 0 16px 34px rgba(255, 111, 97, 0.18);
}

.auth-user {
  display: none;
  align-items: center;
  gap: 10px;
  max-width: 210px;
}

.auth-user.is-visible { display: inline-flex; }
.auth-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auth-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-coral), var(--auth-coral-deep));
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.auth-backdrop.is-open { display: flex; }
body.auth-modal-open { overflow: hidden; }

.auth-modal {
  position: relative;
  display: none;
  width: min(100%, 430px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  padding: clamp(24px, 5vw, 34px);
  border: 1px solid rgba(234, 220, 204, 0.9);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, var(--auth-canvas) 100%);
  box-shadow: 0 28px 90px rgba(37, 33, 29, 0.26);
}

.auth-modal.is-open { display: block; }

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff4ef;
  color: var(--auth-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.auth-close:hover { color: var(--auth-coral-deep); background: #ffe7df; }

.auth-kicker {
  margin: 0 0 10px;
  color: var(--auth-coral);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-modal h2 {
  margin: 0 42px 10px 0;
  color: var(--auth-text);
  font-size: clamp(1.9rem, 6vw, 2.55rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-copy { margin: 0 0 24px; color: var(--auth-muted); }
.auth-form { display: grid; gap: 14px; }

.auth-field { display: grid; gap: 7px; color: var(--auth-text); font-weight: 800; }

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--auth-line);
  border-radius: 15px;
  outline: 0;
  background: #fff;
  color: var(--auth-text);
  font: inherit;
  box-shadow: 0 8px 22px rgba(68, 46, 32, 0.04);
}

.auth-field input::placeholder { color: #b79a86; }
.auth-field input:focus { border-color: var(--auth-coral); box-shadow: 0 0 0 4px rgba(255, 111, 97, 0.14); }

.auth-error {
  display: none;
  margin: 2px 0 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: #fff0ed;
  color: #9b3b31;
  font-weight: 700;
}

.auth-error.is-visible { display: block; }

.auth-submit,
.auth-ghost {
  min-height: 50px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.auth-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-coral), var(--auth-coral-deep));
  box-shadow: 0 16px 36px rgba(255, 111, 97, 0.26);
}

.auth-submit:disabled { cursor: wait; opacity: 0.72; }

.auth-ghost {
  border: 1px solid rgba(255, 111, 97, 0.38);
  background: #fff;
  color: var(--auth-coral-deep);
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--auth-muted);
  text-align: center;
}

.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--auth-coral-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

@media (max-width: 620px) {
  .auth-actions { margin-left: auto; }
  .auth-user { max-width: 154px; padding-inline: 10px 12px; }
  .sign-in-button { min-height: 38px; padding: 0 12px; }
  .auth-backdrop { align-items: end; padding: 12px; }
  .auth-modal { width: 100%; border-radius: 24px; }
}

/* Members section */
.members-only {
  display: none;
  padding: 80px 24px;
  background: var(--auth-canvas);
}
.members-only.is-visible { display: block; }

.members-gate {
  max-width: 560px;
  margin: 0 auto;
}
.members-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(34, 33, 29, 0.08);
}
.members-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.members-card h2 { font-size: 1.75rem; font-weight: 700; margin: 12px 0; }
.members-card p { color: var(--auth-muted); font-size: 1rem; line-height: 1.6; margin: 0 0 28px; }
.members-signin-trigger {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--auth-coral);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}
.members-signin-trigger:hover { background: var(--auth-coral-deep); transform: translateY(-1px); }

.members-dashboard[hidden] { display: none; }
.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--auth-line);
}
.members-header h2 { font-size: 2rem; font-weight: 700; margin: 4px 0 0; }
.members-header .button { border-radius: 999px; padding: 8px 20px; font-size: 0.85rem; }
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.members-card-icon { display: block; font-size: 2rem; margin-bottom: 12px; }
.members-card h3 { font-size: 1.15rem; font-weight: 650; margin: 0 0 8px; color: var(--auth-text); }
.members-card p { font-size: 0.9rem; color: var(--auth-muted); line-height: 1.55; margin: 0 0 16px; }
.members-card .button {
  display: inline-block;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 600px) {
  .members-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .members-grid { grid-template-columns: 1fr 1fr; }
  .members-card { padding: 28px 20px; }
}
