/* Profile Subpages Styling - AICPA & CIMA
   Matches original layouts from contact.png, employment.png, profile_purchases.png */

.subpage-wrap {
  background: #ffffff;
  min-height: calc(100vh - 280px);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #282937;
}

.subpage-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* Back link */
.subpage-back {
  margin-bottom: 1.5rem;
}

.subpage-back a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #282937;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.subpage-back a:hover {
  color: #72246c;
}

.subpage-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Page Title */
.subpage-title {
  font-size: 2.25rem;
  font-weight: 300;
  color: #282937;
  margin: 0 0 1.75rem;
  line-height: 1.2;
}

/* Navigation Tabs */
.subpage-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 2.5rem;
  gap: 2rem;
}

.subpage-tab {
  font-size: 1.0625rem;
  font-weight: 400;
  color: #555555;
  text-decoration: none;
  padding: 0.75rem 0.25rem 0.875rem;
  position: relative;
  transition: color 0.15s ease;
}

.subpage-tab:hover {
  color: #72246c;
}

.subpage-tab.active {
  color: #72246c;
  font-weight: 500;
  border-bottom: 3px solid #72246c;
  margin-bottom: -1px;
}

/* Header with action button (e.g. Edit my contact details) */
.subpage-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.subpage-section-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: #282937;
  margin: 0;
}

.subpage-action-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #72246c;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.subpage-action-link:hover {
  color: #0091bd;
}

/* Key-Value Details List */
.details-group {
  margin-bottom: 2.5rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: baseline;
}

.detail-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #282937;
  margin: 0;
}

.detail-value {
  font-size: 0.9375rem;
  color: #333333;
  margin: 0;
}

.detail-subtext {
  font-size: 0.8125rem;
  color: #718096;
  margin-top: 4px;
}

.detail-badge {
  display: inline-block;
  background: #e6f4ea;
  color: #137333;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 3px 10px;
  border-radius: 12px;
}

/* Card / Box style */
.subpage-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.subpage-empty-notice {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: #282937;
}

.subpage-empty-notice h3 {
  font-size: 1.5rem;
  font-weight: 300;
  margin: 0 0 1rem;
}

.subpage-empty-notice p {
  font-size: 1rem;
  color: #555555;
  margin: 0 0 1.5rem;
}

/* Primary purple button (like "Find out membership offers", "Save", etc.) */
.subpage-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #72246c;
  border: 1px solid #72246c;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subpage-btn-primary:hover {
  background: #72246c;
  color: #ffffff;
}

.subpage-btn-filled {
  background: #72246c;
  color: #ffffff;
  border: 1px solid #72246c;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subpage-btn-filled:hover {
  background: #591b54;
  color: #ffffff;
}

/* Form controls */
.subpage-form-group {
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.subpage-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #282937;
  margin-bottom: 0.5rem;
}

.subpage-select,
.subpage-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #282937;
  box-sizing: border-box;
}

.subpage-select:focus,
.subpage-input:focus {
  outline: none;
  border-color: #72246c;
  box-shadow: 0 0 0 2px rgba(114, 36, 108, 0.2);
}

/* Employment & Experience cards */
.exp-card {
  border-left: 3px solid #72246c;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.exp-card__role {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #282937;
  margin: 0 0 0.25rem;
}

.exp-card__company {
  font-size: 0.9375rem;
  color: #72246c;
  font-weight: 500;
  margin: 0 0 0.35rem;
}

.exp-card__meta {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
}

/* Bottom info/assurance rows */
.subpage-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 3rem 0 2rem;
}

@media (max-width: 768px) {
  .subpage-tabs {
    gap: 1rem;
  }
  .subpage-tab {
    font-size: 0.9375rem;
    padding: 0.5rem 0;
  }
  .detail-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* 15-Second Membership Renewal Loader Overlay */
#membership-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

#membership-loader-overlay.m-loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.m-loader-card {
  text-align: center;
  max-width: 460px;
  width: 90%;
  padding: 2.5rem 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(40, 41, 55, 0.08);
  border: 1px solid #f1e4ef;
}

.m-loader-logo-wrap {
  margin-bottom: 2rem;
}

.m-loader-logo {
  height: 48px;
  width: auto;
}

.m-loader-spinner-box {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.75rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-loader-spinner-outer {
  position: absolute;
  inset: 0;
  border: 3.5px solid #f2e7f1;
  border-top-color: #72246c;
  border-right-color: #9a205f;
  border-radius: 50%;
  animation: m-loader-spin 1.1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.m-loader-spinner-inner {
  position: absolute;
  inset: 8px;
  border: 2px solid #faf5f9;
  border-bottom-color: #72246c;
  border-radius: 50%;
  animation: m-loader-spin-reverse 1.8s linear infinite;
}

.m-loader-icon-center {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes m-loader-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes m-loader-spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

.m-loader-heading {
  font-size: 1.35rem;
  font-weight: 500;
  color: #282937;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.m-loader-desc {
  font-size: 0.9375rem;
  color: #666666;
  margin: 0 0 1.75rem 0;
  line-height: 1.45;
  min-height: 2.8rem;
  transition: opacity 0.25s ease;
}

.m-loader-progress-wrap {
  width: 100%;
  margin-bottom: 1.5rem;
}

.m-loader-progress-bg {
  width: 100%;
  height: 6px;
  background: #f1e4ef;
  border-radius: 999px;
  overflow: hidden;
}

.m-loader-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #72246c 0%, #9a205f 100%);
  border-radius: 999px;
  transition: width 0.12s linear;
}

.m-loader-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #777777;
  margin-top: 0.5rem;
}

.m-loader-member-hint {
  font-size: 0.8125rem;
  color: #555555;
  background: #faf8fb;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid #f0e6ee;
}

/* Transactions & Invoices Styling */
.transactions-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 2.5rem;
}

.transactions-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fcfcfd;
  border-bottom: 1px solid #edf2f7;
}

.transaction-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.transaction-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.transaction-table td {
  padding: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #282937;
}

.transaction-table tbody tr:hover {
  background-color: #fbfbfe;
}

.tx-date-main {
  display: block;
  font-weight: 500;
  color: #1e293b;
}

.tx-date-time {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 2px;
}

.tx-desc-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.tx-desc-sub {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.35;
}

.tx-ref code {
  font-family: monospace;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.tx-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #72246c;
  border: 1px solid #72246c;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tx-receipt-btn:hover {
  background: #72246c;
  color: #ffffff;
}

/* Receipt Modal */
.receipt-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.receipt-modal-backdrop.is-open {
  display: flex;
}

.receipt-modal-card {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.2), 0 10px 15px -5px rgba(0, 0, 0, 0.08);
  padding: 2.25rem;
  position: relative;
  box-sizing: border-box;
  animation: receiptModalFadeIn 0.2s ease-out;
}

@keyframes receiptModalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.receipt-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
}

.receipt-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #72246c;
  margin-bottom: 1.5rem;
}

.receipt-logo {
  height: 38px;
  width: auto;
}

.receipt-type-badge {
  text-align: right;
}

.receipt-type-badge h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #72246c;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-type-badge p {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.receipt-info-col h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.receipt-info-col p {
  font-size: 0.875rem;
  color: #1e293b;
  margin: 0 0 3px;
  line-height: 1.4;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.receipt-items-table th {
  background: #f8fafc;
  padding: 8px 12px;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.receipt-items-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #1e293b;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  margin-bottom: 1.75rem;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  width: 240px;
  font-size: 0.875rem;
  color: #475569;
}

.receipt-total-row.grand-total {
  font-size: 1.125rem;
  font-weight: 700;
  color: #72246c;
  padding-top: 6px;
  border-top: 2px solid #e2e8f0;
}

.receipt-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}


