/* ==========================================
   GYM MANAGER STYLES (styles.css)
   High-contrast, mobile-first athletic UI
   ========================================== */

:root {
  --bg: #0b1120;
  --surface: #131c31;
  --surface-alt: #1c2742;
  --border: #283554;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #10b981;
  --primary-hover: #059669;
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Header / Navbar ---------- */
.topbar {
  background: rgba(19, 28, 49, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #042f2e;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #052e16;
}

.btn-whatsapp:hover:not(:disabled) {
  background: #20bd5a;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-alt);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero Section (Public Page) ---------- */
.hero {
  padding: 52px 0 36px;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: 1.02rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 18px;
}

/* ---------- Cards & Grids ---------- */
.section {
  padding: 28px 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.grid-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.plan-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.plan-price {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 6px 0 12px;
}

/* ---------- Forms & DPDP Consent ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

input, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

.consent-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ---------- Admin Dashboard Specifics ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

@media (min-width: 680px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

.tab-btn {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--primary);
  color: #042f2e;
  border-color: var(--primary);
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 680px) {
  .member-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.member-name {
  font-weight: 800;
  font-size: 1.02rem;
}

.member-sub {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 3px;
}

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-left: 6px;
}

.status-ok {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.status-soon {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.status-expired {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Modal & Centered Alerts ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
  max-width: 420px;
}

.alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-top: 14px;
  display: none;
  text-align: center;
}

.alert.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.alert br {
  display: none;
}

.alert .btn {
  margin-top: 10px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.footer {
  text-align: center;
  padding: 32px 0;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}