/* =========================================================
   TYPOGRAPHY
   ========================================================= */
.elms-sans-body {
  font-family: "Elms Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

body {
  font-family:
    "Elms Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  line-height: 30px;
  font-weight: 300;
}

/* =========================================================
   HEADER
   ========================================================= */
header {
  background: #41b8e5;
  color: white;
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

header h1 {
  text-align: center;
  margin: 0;
  width: 100%;
}

header button {
  background: white;
  color: #c62828;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
/* =========================================================
   LAYOUT
   ========================================================= */
main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.hero h2 {
  margin-top: 0;
}

/* Cards / Containers */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.account-card {
  padding: 30px;
  border-radius: 20px; /* keeps your lovely rounded feel */
}

.account-wrapper {
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* =========================================================
   FORMS
   ========================================================= */
label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
}

input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  margin-top: 0.75rem;
  background: #c62828;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: #555;
}

/* =========================================================
   STATUS MESSAGES
   ========================================================= */
.error {
  color: #c62828;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.success {
  color: green;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.paid {
  background: #e0f2f1;
  color: #00796b;
}

.badge.unpaid {
  background: #ffebee;
  color: #c62828;
}

/* =========================================================
   INFO GRID (Member fields)
   ========================================================= */
.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 6px 0;
  align-items: center;
}

.info-label {
  font-weight: 600;
  color: #000;
}

.info-value {
  font-size: 1rem;
  color: #333;
}

/* =========================================================
   PAYMENT SELECTION BLOCK
   ========================================================= */
.payment-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 35px;
  margin-bottom: 20px;
  width: 100%;
}

.payment-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.payment-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.pay-btn {
  min-width: 110px;
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* =========================================================
   TABLES (Payment history)
   ========================================================= */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid #ddd;
  padding: 6px 4px;
  text-align: left;
}

.history-table th {
  font-weight: 600;
}
/* ------------------------------------------------------
   MOBILE RESPONSIVE FIXES (iOS overflow protection)
   ------------------------------------------------------ */
@media (max-width: 600px) {
  /* Force wrapping for long data items (emails, long names) */
  .info-value {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }

  /* Narrower button layout on small screens */
  .payment-buttons {
    flex-wrap: wrap;
    gap: 10px;
  }

  .pay-btn {
    min-width: 90px;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Ensure title does not overflow */
  .payment-title {
    font-size: 1rem;
    padding: 0 10px;
  }

  /* Reduce card horizontal padding on mobile */
  .account-card {
    padding: 20px;
  }

  /* Reduce grid column widths so labels don’t push content off screen */
  .info-row {
    grid-template-columns: 130px 1fr;
  }
}
