/* ============================================================
   GAMA Membership Checker – Styles
   Fonts & palette drawn from gamaatl.org
   ============================================================ */

:root {
  --color-primary: #1a3a5c;      /* deep navy */
  --color-accent:  #c0392b;      /* GAMA red  */
  --color-accent-hover: #a93226;
  --color-bg:      #f5f6f8;
  --color-card:    #ffffff;
  --color-text:    #2c3e50;
  --color-muted:   #6b7c93;
  --color-border:  #dce1e8;
  --color-success: #27ae60;
  --color-warn:    #e67e22;
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius:        10px;
  --shadow:        0 4px 24px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: #ffffff;
  min-height: 100vh;
}

/* Global header – full browser width */
.global-header {
  width: 100%;
  background: #ffffff;
  text-align: center;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.global-header-logo {
  max-width: 720px;
  width: 100%;
  height: auto;
  display: inline-block;
}
.global-header-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.global-header-inner .global-header-logo { max-width: 720px; }
.global-header-action,
.header-actions {
  position: absolute;
  top: 0;
  right: 0;
}
.header-actions { display: flex; gap: .5rem; }

/* Layout */
.page-wrapper {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Card */
.card {
  background: #ffffff;
  padding: 0;
  width: 100%;
}

/* Legacy site-header inside card (for dashboard/admin pages) */
.site-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.banner-logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: .5rem;
}

.subtitle {
  text-align: center;
  color: var(--color-muted);
  font-size: .925rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* Form */
.input-group {
  display: flex;
  gap: .5rem;
}

.email-autocomplete {
  flex: 1;
  position: relative;
}

.input-group input {
  width: 100%;
  padding: .75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s;
}
.input-group input:focus {
  border-color: var(--color-primary);
}

/* Email domain suggestions */
.email-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  max-height: 220px;
  overflow-y: auto;
}
.email-suggestions li {
  padding: .6rem 1rem;
  font-size: .95rem;
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--color-text);
}
.email-suggestions li:hover,
.email-suggestions li.active {
  background: #f0f2f5;
}
.email-suggestions li strong {
  color: var(--color-muted);
}

.input-group button {
  padding: .75rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}
.input-group button:hover { background: var(--color-accent-hover); }
.input-group button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Spinner inside button */
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Errors */
.form-error {
  color: var(--color-accent);
  font-size: .85rem;
  margin-top: .5rem;
}

/* Result */
.result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  line-height: 1.6;
}

.result.role-primary {
  background: #eafaf1;
  border-left: 4px solid var(--color-success);
}
.result.role-spouse {
  background: #fef9e7;
  border-left: 4px solid var(--color-warn);
}
.result.role-none {
  background: #fdf2f2;
  border-left: 4px solid var(--color-accent);
}
.result.role-inactive {
  background: #fef9e7;
  border-left: 4px solid var(--color-warn);
}

.result .role-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.result .role-label.primary { color: var(--color-success); }
.result .role-label.spouse  { color: var(--color-warn); }
.result .role-label.none    { color: var(--color-accent); }
.result .role-label.inactive { color: var(--color-warn); }

.result .phone-hint {
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--color-muted);
}

.paired-member {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--color-border);
  font-size: .9rem;
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* Footer (inside card) */
.site-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--color-muted);
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0; }
.legal { margin-top: .25rem; font-size: .65rem; }

/* Stats bar */
.stats-bar {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.stats-text {
  font-size: .95rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: .6rem;
}
.stats-text span {
  font-weight: 700;
  color: var(--color-primary);
}
.progress-track {
  width: 100%;
  height: 12px;
  background: #e8ecf1;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: 6px;
  transition: width .8s ease-out;
}

/* Login section (after membership check) */
.login-section {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.login-section-text {
  font-size: .9rem;
  color: var(--color-muted);
  margin-bottom: .75rem;
}
.btn-full { width: 100%; justify-content: center; }

.link-btn {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

/* Header row (logo + actions) */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-row .banner-logo { max-width: 240px; }
.header-actions { display: flex; gap: .5rem; }

/* Buttons */
.btn-primary {
  padding: .65rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; }

.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #96281b; }

.btn-secondary {
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-primary);
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-secondary:hover {
  border-color: var(--color-primary);
  background: #f0f2f5;
}
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* Section titles */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: .75rem;
}

/* Loading */
.loading-msg {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 0;
}

/* Textarea */
textarea {
  width: 100%;
  padding: .75rem 1rem;
  font-size: .95rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
textarea:focus { border-color: var(--color-primary); }

/* Member card */
.member-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .75rem;
}
.member-role {
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--color-primary);
  margin-bottom: .35rem;
}
.member-detail {
  font-size: .9rem;
  margin-top: .2rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}
.tab {
  padding: .6rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .2s;
}
.tab:hover { color: var(--color-text); }
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Search bar */
.search-bar {
  margin-bottom: 1rem;
}
.search-bar input {
  width: 100%;
  padding: .65rem 1rem;
  font-size: .9rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
}
.search-bar input:focus { border-color: var(--color-primary); }

/* Table */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
th, td {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
th {
  font-weight: 600;
  color: var(--color-primary);
  background: #f8f9fb;
  position: sticky;
  top: 0;
}
tbody tr:hover { background: #f8f9fb; }
.table-count {
  font-size: .8rem;
  color: var(--color-muted);
  margin-top: .5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-active { background: #eafaf1; color: var(--color-success); }
.badge-pending { background: #fef9e7; color: var(--color-warn); }

/* Summary table */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .5rem;
  font-size: .9rem;
}
.summary-table th, .summary-table td {
  padding: .4rem .75rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.summary-table th { background: transparent; font-weight: 600; }
.summary-table td:first-child { text-align: left; font-weight: 500; }
.summary-table th:first-child { text-align: left; }

/* Admin card */
.admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: .5rem;
}
.admin-card .phone-hint { margin-left: .75rem; }

/* File upload */
.file-upload-area input[type="file"] {
  font-family: var(--font-body);
  font-size: .9rem;
}

/* Wide page wrapper (for admin) */
.page-wrapper--wide { max-width: 960px; }

/* Responsive */
@media (max-width: 640px) {
  .page-wrapper { padding: 1.5rem 1rem; }
  .global-header { padding: 1rem .75rem; }
  .global-header-logo { max-width: 100%; }
  .global-header-inner .global-header-logo { max-width: 100%; }
  .card h1 { font-size: 1.4rem; }
  .subtitle { font-size: .875rem; }
}

@media (max-width: 480px) {
  .input-group {
    flex-direction: column;
  }
  .input-group button {
    width: 100%;
    justify-content: center;
  }
  .global-header-action,
  .header-actions { position: static; margin-top: .75rem; justify-content: center; }
  .tabs { overflow-x: auto; }
  .tab { padding: .5rem .75rem; font-size: .8rem; }
  .admin-card { flex-direction: column; align-items: flex-start; gap: .5rem; }
}
