* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  min-height: 100%;
  color: #1a1a1a;
  background: #f6f7fb;
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(220, 20, 60, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.35), transparent 30%),
    linear-gradient(180deg, #b00020 0%, #d90429 42%, #ffffff 100%);
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.16), rgba(255,255,255,0.56));
  z-index: -1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(176, 0, 32, 0.10);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 24px 60px rgba(78, 7, 19, 0.16);
  backdrop-filter: blur(10px);
}

.brand-block {
  margin-bottom: 28px;
}

.brand-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #b00020;
}

.brand-subtitle {
  margin-top: 8px;
  color: #6f1d2c;
  font-size: 15px;
}

h1, h2, h3 {
  margin: 0 0 14px;
  line-height: 1.1;
  color: #8f001a;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
  color: #7c1024;
}

p {
  margin-top: 0;
}

.intro {
  margin: 0 0 22px;
  color: #5f3340;
  line-height: 1.6;
}

.form-card {
  display: grid;
  gap: 14px;
}

label {
  font-size: 15px;
  font-weight: 700;
  color: #6d1023;
}

input {
  width: 100%;
  border: 1px solid rgba(176, 0, 32, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: #1a1a1a;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 16px;
  outline: none;
}

input::placeholder {
  color: #9b7b84;
}

input:focus {
  border-color: rgba(176, 0, 32, 0.35);
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.08);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #b00020 0%, #e3062f 100%);
  box-shadow: 0 12px 24px rgba(176, 0, 32, 0.18);
}

.btn-secondary {
  color: #8f001a;
  background: #ffffff;
  border: 1px solid rgba(176, 0, 32, 0.14);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-result {
  border-radius: 18px;
  padding: 18px 20px;
  font-weight: 600;
  line-height: 1.55;
}

.form-result.ok {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,245,247,0.98));
  border: 1px solid rgba(176, 0, 32, 0.14);
  color: #5f1222;
}

.form-result.err {
  background: rgba(110, 18, 40, 0.08);
  border: 1px solid rgba(220, 20, 60, 0.22);
  color: #8b1730;
}

.dashboard-shell {
  place-items: start center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.dashboard-page .login-card,
.dashboard-card {
  max-width: 1180px;
  padding: 36px;
}

.brand-block-dashboard {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand-block-dashboard-tight {
  margin-bottom: 0;
}

.dashboard-badge {
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(176, 0, 32, 0.08);
  border: 1px solid rgba(176, 0, 32, 0.14);
  color: #8f001a;
  font-size: 13px;
  font-weight: 800;
}

.member-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(176, 0, 32, 0.10);
}

.member-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.member-topbar-link {
  text-decoration: none;
  text-align: center;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-panel-enhanced {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  color: #b00020;
}

.hero-intro {
  max-width: 720px;
  margin-bottom: 18px;
}

.member-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.member-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #8f001a;
  background: rgba(176, 0, 32, 0.06);
  border: 1px solid rgba(176, 0, 32, 0.12);
  transition: all 0.15s ease;
}

.member-nav-link:hover,
.member-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #b00020 0%, #d90429 100%);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(176, 0, 32, 0.18);
}

.profile-box {
  display: block;
  min-height: 120px;
}

.profile-box strong {
  color: #8f001a;
}

.dashboard-overview-section {
  margin-bottom: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,249,0.98));
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(176, 0, 32, 0.10);
  box-shadow: 0 10px 24px rgba(92, 17, 31, 0.06);
}

.stat-card-accent {
  background: linear-gradient(135deg, rgba(176,0,32,0.94), rgba(217,4,41,0.94));
  color: #ffffff;
}

.stat-card-accent .stat-label,
.stat-card-accent .stat-value,
.stat-card-accent .stat-note {
  color: #ffffff;
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: #7a3a47;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: #8f001a;
  margin-bottom: 8px;
}

.stat-value-small {
  font-size: 24px;
}

.stat-note {
  font-size: 13px;
  color: #6e4650;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dashboard-section {
  scroll-margin-top: 24px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  padding: 24px;
  border: 1px solid rgba(176, 0, 32, 0.10);
  box-shadow: 0 14px 34px rgba(92, 17, 31, 0.08);
}

.dashboard-section-wide {
  grid-column: 1 / -1;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin-bottom: 0;
}

.section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #b00020;
  font-weight: 800;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(176, 0, 32, 0.08);
  color: #8f001a;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid rgba(176, 0, 32, 0.10);
  box-shadow: 0 8px 22px rgba(92, 17, 31, 0.05);
}

.card-text {
  margin: 0;
  line-height: 1.68;
  color: #5f3340;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta {
  font-size: 12px;
  opacity: .7;
  margin-bottom: 8px;
  color: #7f5560;
}

small {
  color: #6f4751;
}

.profile-lines {
  display: grid;
  gap: 12px;
}

.profile-line {
  display: grid;
  gap: 4px;
}

.profile-label {
  font-size: 13px;
  font-weight: 700;
  opacity: .75;
  color: #7a3a47;
}

.profile-value {
  font-size: 18px;
  font-weight: 800;
  color: #8f001a;
  word-break: break-word;
}

.push-panel {
  display: grid;
  gap: 16px;
}

.push-status-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,249,0.98));
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(176, 0, 32, 0.10);
  box-shadow: 0 8px 22px rgba(92, 17, 31, 0.05);
}

.push-status-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 800;
  color: #b00020;
  margin-bottom: 10px;
}

.push-status-value {
  font-size: 24px;
  font-weight: 800;
  color: #8f001a;
  line-height: 1.2;
  margin-bottom: 8px;
}

.push-status-hint {
  color: #6f4751;
  line-height: 1.55;
}

.push-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.push-help {
  display: grid;
  gap: 10px;
}

.push-help-item {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(176, 0, 32, 0.10);
  border-radius: 16px;
  padding: 14px 16px;
  color: #6f4751;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-section-wide {
    grid-column: auto;
  }

  .member-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .member-topbar-actions {
    width: 100%;
  }

  .member-topbar-actions .btn,
  .member-topbar-actions .member-topbar-link {
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 24px;
    border-radius: 22px;
  }

  .dashboard-page .login-card,
  .dashboard-card {
    padding: 24px;
  }

  .brand-block-dashboard {
    flex-direction: column;
  }

  .dashboard-badge {
    white-space: normal;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  .button-row,
  .quick-actions,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .member-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .member-nav-link {
    width: 100%;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .member-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .member-topbar-actions .btn,
  .member-topbar-actions .member-topbar-link {
    width: 100%;
  }

  .push-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .push-actions .btn {
    width: 100%;
  }
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.calendar-actions .btn {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 10px;
  min-width: auto;
  width: auto;
}

.calendar-url-box {
  margin-top: 16px;
  background: rgba(255,255,255,0.85);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(176,0,32,0.10);
}

.calendar-url-label {
  font-size: 12px;
  opacity: .7;
  margin-bottom: 4px;
}

.calendar-url-value {
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
}

.calendar-help {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.calendar-help-item {
  background: rgba(255,255,255,0.85);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .calendar-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-actions .btn {
    width: auto;
  }
}

@media (max-width: 640px) {
  .dashboard-section {
    padding: 18px;
  }

  .card {
    padding: 14px;
    margin-top: 10px;
    border-radius: 16px;
  }

  .card h3 {
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 10px;
    word-break: break-word;
  }

  .meta {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 10px;
  }

  .card-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  #memberEvents .card,
  #memberPosts .card {
    overflow: hidden;
  }
}

/* ===== POLLS FIX ===== */
.poll-option {
  display: block;
  cursor: pointer;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(176, 0, 32, 0.10);
  background: rgba(255, 248, 250, 0.88);
}

.poll-option-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.poll-option-text {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.poll-option-bar {
  height: 8px;
  background: rgba(176, 0, 32, 0.10);
  border-radius: 999px;
  overflow: hidden;
}

.poll-option-bar-fill {
  height: 8px;
  background: #d90429;
  border-radius: 999px;
}

.poll-option-meta {
  display: block;
  margin-top: 6px;
  opacity: .85;
}

.poll-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.poll-description {
  margin-top: 4px;
  opacity: .85;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .poll-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .poll-footer .btn {
    width: 100%;
  }
}
