/* ============================================================
   style.css — Zionhill Global Partnership System
   Aesthetic: Sacred-modern. Deep navy + warm gold. Editorial serif
   meets clean data. Premium feel for a premium community.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --navy:    #0D1B2E;
  --navy2:   #142338;
  --navy3:   #1E3354;
  --gold:    #C8992A;
  --gold2:   #E8B84B;
  --gold3:   #F5D07A;
  --cream:   #FDF8EE;
  --muted:   #8A9BB0;
  --danger:  #E05A5A;
  --success: #3DBE7A;
  --white:   #FFFFFF;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  --radius:  12px;
  --radius-sm: 8px;
  --shadow:  0 4px 24px rgba(0,0,0,.18);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.12);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ── Auth Pages (login / register) ─────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-hero {
  background: linear-gradient(160deg, var(--navy3) 0%, var(--navy) 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C8992A' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .6;
}

.auth-hero .logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 60px;
}

.logo-mark {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold3));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  color: var(--navy);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: .01em;
  line-height: 1.2;
}
.logo-text span { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); font-family: var(--font-body); }

.auth-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 600;
  color: var(--cream);
  line-height: 1.18;
  position: relative;
  margin-bottom: 20px;
}

.auth-hero h1 em { color: var(--gold2); font-style: normal; }

.auth-hero p {
  color: var(--muted);
  font-size: .95rem;
  max-width: 340px;
  position: relative;
}

.auth-hero .stats-row {
  display: flex; gap: 28px;
  margin-top: 56px;
  position: relative;
}

.hero-stat { text-align: center; }
.hero-stat .val { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold2); font-weight: 600; }
.hero-stat .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

.auth-form-panel {
  background: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  overflow-y: auto;
}

.auth-form-panel h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 6px;
  font-weight: 600;
}
.auth-form-panel .subtitle {
  color: #607080;
  font-size: .9rem;
  margin-bottom: 32px;
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #5A6A7A;
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #D0D9E4;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,153,42,.15);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Plan selector */
.plan-type-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; border: 1.5px solid #D0D9E4; border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 14px;
}
.plan-type-toggle label {
  padding: 10px; text-align: center; cursor: pointer;
  font-size: .85rem; font-weight: 500; color: #607080;
  background: var(--white); transition: all .2s;
  letter-spacing: 0; text-transform: none;
}
.plan-type-toggle input[type=radio] { display: none; }
.plan-type-toggle input:checked + label {
  background: var(--navy); color: var(--gold2); font-weight: 600;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  transition: all .2s; letter-spacing: .01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(200,153,42,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,153,42,.45); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold2);
}
.btn-outline:hover { background: rgba(200,153,42,.1); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm { padding: 8px 16px; font-size: .82rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ── App Shell (dashboard) ──────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--navy2);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-text { font-size: .9rem; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-section-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: #8A9BB0; font-size: .88rem; font-weight: 500;
  transition: all .18s; margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.nav-item.active {
  background: rgba(200,153,42,.15);
  color: var(--gold2);
}
.nav-item .icon { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold3));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--navy);
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: .7rem; color: var(--muted); }

/* Main content */
.main-content {
  background: var(--navy);
  overflow-y: auto;
}

.page-header {
  padding: 32px 36px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 600; color: var(--cream);
}
.page-header .breadcrumb {
  font-size: .78rem; color: var(--muted); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .06em;
}

.content-body { padding: 32px 36px; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.gold::before  { background: linear-gradient(90deg, var(--gold), var(--gold3)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #7EDEA8); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--danger), #F09090); }
.stat-card.blue::before  { background: linear-gradient(90deg, #4A90D9, #7BB8F0); }

.stat-icon {
  font-size: 1.5rem; margin-bottom: 12px;
  display: inline-block;
}
.stat-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 600; color: var(--cream);
  line-height: 1;
}
.stat-value.large { font-size: 2rem; }
.stat-sub {
  font-size: .75rem; color: var(--muted); margin-top: 4px;
}

/* ── Cards / Panels ─────────────────────────────────────────── */
.card {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--cream);
}
.card-body { padding: 20px 24px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th {
  text-align: left; padding: 10px 16px;
  font-size: .7rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #C8D4E0;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-success { background: rgba(61,190,122,.15); color: #5DE89D; }
.badge-danger  { background: rgba(224,90,90,.15);  color: #F08080; }
.badge-warning { background: rgba(200,153,42,.15); color: var(--gold2); }
.badge-muted   { background: rgba(138,155,176,.1); color: var(--muted); }

/* ── Streak Widget ──────────────────────────────────────────── */
.streak-ring {
  width: 90px; height: 90px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.streak-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.streak-ring .val {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 700;
  color: var(--gold2); position: relative;
}
.streak-ring .lbl {
  font-size: .65rem; color: var(--muted); text-align: center;
  margin-top: 2px; position: absolute; bottom: -18px; width: 100%; text-align: center;
}

/* ── Plan Banner ────────────────────────────────────────────── */
.plan-banner {
  background: linear-gradient(135deg, rgba(200,153,42,.15), rgba(200,153,42,.05));
  border: 1px solid rgba(200,153,42,.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.plan-banner .plan-info .plan-name {
  font-family: var(--font-display); font-size: 1.4rem; color: var(--gold2); font-weight: 600;
}
.plan-banner .plan-info .plan-freq {
  font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em;
  margin-top: 2px;
}

/* ── Timeline / Payment History ─────────────────────────────── */
.payment-timeline { position: relative; padding-left: 20px; }
.payment-timeline::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 1px; background: rgba(255,255,255,.07);
}
.timeline-item {
  position: relative; padding: 0 0 20px 24px;
}
.timeline-item::before {
  content: ''; position: absolute; left: -14px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy2); border: 2px solid var(--muted);
}
.timeline-item.paid::before  { background: var(--success); border-color: var(--success); }
.timeline-item.missed::before { background: var(--danger);  border-color: var(--danger); }
.timeline-item.pending::before { background: var(--gold);   border-color: var(--gold); }

.timeline-date { font-size: .75rem; color: var(--muted); margin-bottom: 3px; }
.timeline-title { font-size: .9rem; color: var(--cream); font-weight: 500; }
.timeline-amount { font-size: .8rem; color: var(--gold2); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8,16,28,.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--cream);
}
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.3rem;
  cursor: pointer; padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--white); }

.modal-body { padding: 22px 24px; }

/* ── Filters bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: var(--white);
  padding: 9px 14px; font-size: .85rem;
  outline: none;
}
.filter-bar input::placeholder { color: var(--muted); }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--gold); }

/* ── Upload area ────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed rgba(200,153,42,.35);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(200,153,42,.04);
}
.upload-area:hover { border-color: var(--gold); background: rgba(200,153,42,.08); }
.upload-area p { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.upload-area .icon { font-size: 2rem; }
#fileInput { display: none; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--navy3); color: var(--white);
  padding: 13px 20px; border-radius: var(--radius-sm);
  font-size: .87rem; font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0;
  transition: all .3s; max-width: 320px;
  border-left: 3px solid var(--gold);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.toast-success { border-color: var(--success); }
.toast.toast-error   { border-color: var(--danger); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h4 { font-family: var(--font-display); font-size: 1.2rem; color: var(--cream); margin-bottom: 6px; }
.empty-state p { font-size: .85rem; }

/* ── Loading ────────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; color: var(--muted); gap: 12px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-panel { padding: 40px 28px; }

  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .page-header { padding: 20px 20px 16px; flex-direction: column; gap: 12px; }
  .content-body { padding: 20px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-form-panel { padding: 32px 20px; }
}

/* ── Misc utils ─────────────────────────────────────────────── */
.text-gold   { color: var(--gold2); }
.text-muted  { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm  { font-size: .8rem; }
.text-xs  { font-size: .72rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex  { display: flex; align-items: center; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 20px; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hidden { display: none !important; }
.fw-600 { font-weight: 600; }
