/* ============================================================
   FAERY TECH CLIENT PORTAL — portal.css
   Dark forest aesthetic. Playfair Display + Nunito.
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --forest:        #080f08;
  --forest-mid:    #0f1a0f;
  --forest-card:   #131c13;
  --forest-raised: #192319;
  --gold:          #c9954a;
  --gold-dim:      #9a6f30;
  --gold-glow:     rgba(201, 149, 74, 0.15);
  --sage:          #5a9a5a;
  --sage-dim:      #3d6e3d;
  --cream:         #f0ede6;
  --muted:         #8a8a7a;
  --muted-light:   #b0a898;
  --card-bg:       rgba(255, 255, 255, 0.025);
  --card-border:   rgba(201, 149, 74, 0.18);
  --sidebar-w:     240px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--forest);
  color: var(--cream);
  min-height: 100vh;
  font-size: 1rem;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }
button { cursor: pointer; font-family: 'Nunito', sans-serif; }
input, textarea, select {
  font-family: 'Nunito', sans-serif;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--cream);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: rgba(240,237,230,0.3); }
select option { background: var(--forest-mid); }

/* ── Firefly canvas ── */
#fireflies {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

/* ── Utilities ── */
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2.5rem; }
.hidden { display: none !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.75rem; border-radius: 50px; border: none;
  font-size: 0.88rem; font-weight: 700; letter-spacing: 0.05em;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--forest); box-shadow: 0 0 24px rgba(201,149,74,0.3);
}
.btn-gold:hover { box-shadow: 0 0 40px rgba(201,149,74,0.5); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold-glow); }
.btn-sage {
  background: linear-gradient(135deg, var(--sage-dim), var(--sage));
  color: #fff; box-shadow: 0 0 20px rgba(90,154,90,0.3);
}
.btn-sage:hover { box-shadow: 0 0 36px rgba(90,154,90,0.5); }
.btn-ghost {
  background: transparent; color: var(--muted-light);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { border-color: var(--card-border); color: var(--cream); }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 1.75rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover { border-color: rgba(201,149,74,0.35); }
.card-gold {
  background: linear-gradient(135deg, rgba(201,149,74,0.08), rgba(201,149,74,0.03));
  border-color: rgba(201,149,74,0.35);
}
.card-sage {
  background: linear-gradient(135deg, rgba(90,154,90,0.08), rgba(90,154,90,0.03));
  border-color: rgba(90,154,90,0.3);
}

/* ── Labels ── */
.label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
}
.label-sage { color: var(--sage); }
.label-muted { color: var(--muted); }

/* ── Section title ── */
.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--cream); margin-bottom: 0.25rem; line-height: 1.2;
}

/* ── Alerts ── */
.alert {
  padding: 0.85rem 1.1rem; border-radius: 10px;
  font-size: 0.88rem; font-weight: 600; line-height: 1.5;
  margin-bottom: 1rem;
}
.alert-error { background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.3); color: #ff9090; }
.alert-success { background: rgba(90,154,90,0.1); border: 1px solid rgba(90,154,90,0.3); color: #90c890; }
.alert-info { background: rgba(201,149,74,0.08); border: 1px solid rgba(201,149,74,0.25); color: var(--gold); }

/* ══════════════════════════════════════
   AUTH PAGE (index.html)
   ══════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  position: relative; z-index: 1;
}

.auth-card {
  background: var(--forest-card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 440px;
  box-shadow: 0 0 80px rgba(0,0,0,0.6), 0 0 40px rgba(201,149,74,0.06);
}

.auth-logo {
  text-align: center; margin-bottom: 2rem;
}
.auth-logo-mark {
  font-size: 2rem; display: block; margin-bottom: 0.4rem;
}
.auth-logo h1 {
  font-size: 1.4rem; color: var(--cream);
}
.auth-logo p {
  font-size: 0.78rem; color: var(--muted); font-family: 'Nunito', sans-serif;
  margin-top: 0.2rem; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Tab switcher */
.auth-tabs {
  display: flex; border-bottom: 1px solid var(--card-border);
  margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1; padding: 0.65rem; text-align: center;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.form-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-light); margin-bottom: 0.35rem;
}

.auth-divider {
  text-align: center; font-size: 0.75rem; color: var(--muted);
  margin: 0.5rem 0; font-family: 'Nunito', sans-serif;
}

.auth-pending {
  text-align: center; padding: 1.5rem 0.5rem;
}
.auth-pending .pending-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.auth-pending h2 { font-size: 1.2rem; color: var(--cream); margin-bottom: 0.5rem; }
.auth-pending p { font-size: 0.88rem; color: var(--muted); line-height: 1.65; font-weight: 400; }

/* ══════════════════════════════════════
   PORTAL LAYOUT (dashboard + admin)
   ══════════════════════════════════════ */

.portal {
  display: flex; min-height: 100vh;
  position: relative; z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--forest-mid);
  border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50; transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--card-border);
}
.sidebar-brand-mark {
  font-size: 1.3rem; font-family: 'Playfair Display', serif;
  color: var(--gold); display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.sidebar-brand-sub {
  font-size: 0.67rem; color: var(--muted); letter-spacing: 0.12em;
  text-transform: uppercase; font-family: 'Nunito', sans-serif;
}

.sidebar-nav {
  flex: 1; padding: 1.25rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  overflow-y: auto;
}

.sidebar-link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 0.85rem; border-radius: 10px;
  font-size: 0.85rem; font-weight: 600; color: var(--muted-light);
  background: none; border: none; width: 100%; text-align: left;
  transition: background 0.2s, color 0.2s;
}
.sidebar-link:hover { background: var(--gold-glow); color: var(--cream); }
.sidebar-link.active { background: var(--gold-glow); color: var(--gold); }
.sidebar-link-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }

.sidebar-section-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); padding: 0.85rem 0.85rem 0.3rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--card-border);
}
.sidebar-user {
  font-size: 0.8rem; color: var(--muted-light); margin-bottom: 0.75rem; line-height: 1.4;
}
.sidebar-user strong { display: block; color: var(--cream); font-size: 0.88rem; margin-bottom: 0.1rem; }

/* ── Main content ── */
.portal-main {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

.portal-header {
  padding: 1.75rem 2rem 0;
}
.portal-header-eyebrow { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.3rem; font-family: 'Nunito', sans-serif; font-weight: 700; }
.portal-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--cream); }

.portal-content {
  padding: 1.75rem 2rem 4rem;
  display: flex; flex-direction: column; gap: 2rem;
}

/* ── Mobile hamburger ── */
.sidebar-toggle {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 200;
  background: var(--forest-card); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 0.5rem 0.65rem;
  flex-direction: column; gap: 4px;
}
.sidebar-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--gold); border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ══════════════════════════════════════
   DASHBOARD COMPONENTS
   ══════════════════════════════════════ */

/* Package card */
.package-card {
  background: linear-gradient(135deg, rgba(201,149,74,0.1) 0%, rgba(201,149,74,0.03) 100%);
  border: 1px solid rgba(201,149,74,0.35);
  border-radius: 20px; padding: 2rem;
}
.package-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.package-icon { font-size: 2rem; margin-bottom: 0.4rem; display: block; }
.package-name { font-family: 'Playfair Display', serif; font-size: clamp(1.3rem, 2.5vw, 1.8rem); color: var(--cream); margin-bottom: 0.2rem; }
.package-price { font-size: 0.85rem; color: var(--gold); font-weight: 700; font-family: 'Nunito', sans-serif; }
.package-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.4rem 1rem; }
.package-feature {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--muted-light); font-weight: 400;
}
.package-feature::before { content: '✦'; color: var(--gold); font-size: 0.6rem; flex-shrink: 0; }

/* Active services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.service-pill {
  background: var(--card-bg); border: 1px solid rgba(90,154,90,0.3);
  border-radius: 14px; padding: 1.1rem;
}
.service-pill-icon { font-size: 1.3rem; margin-bottom: 0.4rem; display: block; }
.service-pill-name { font-size: 0.88rem; font-weight: 700; color: var(--cream); margin-bottom: 0.15rem; }
.service-pill-price { font-size: 0.75rem; color: var(--sage); font-weight: 700; }
.service-pill-date { font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; font-weight: 400; }

/* Update timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; gap: 0; flex-shrink: 0; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 0.35rem;
}
.timeline-line { flex: 1; width: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-body { flex: 1; }
.timeline-badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 20px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.35rem; font-family: 'Nunito', sans-serif;
  background: rgba(255,255,255,0.06);
}
.timeline-message { font-size: 0.88rem; color: var(--cream); line-height: 1.55; font-weight: 400; margin-bottom: 0.2rem; }
.timeline-date { font-size: 0.72rem; color: var(--muted); }

/* Reports */
.reports-list { display: flex; flex-direction: column; gap: 0.6rem; }
.report-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1.1rem;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px;
}
.report-row-left { display: flex; align-items: center; gap: 0.65rem; }
.report-icon { font-size: 1.1rem; }
.report-month { font-size: 0.88rem; font-weight: 700; color: var(--cream); }
.report-date { font-size: 0.72rem; color: var(--muted); }

/* Upgrade cards */
.upgrades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.upgrade-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.upgrade-card:hover { border-color: rgba(201,149,74,0.4); box-shadow: 0 0 30px rgba(201,149,74,0.08); }
.upgrade-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.upgrade-name { font-size: 0.92rem; font-weight: 700; color: var(--cream); margin-bottom: 0.35rem; }
.upgrade-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.6; font-weight: 400; flex: 1; margin-bottom: 1rem; }
.upgrade-price { font-size: 0.82rem; color: var(--gold); font-weight: 700; margin-bottom: 0.75rem; }
.upgrade-badge { font-size: 0.65rem; color: var(--sage); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.2rem; }

/* Site update request form */
.request-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
.request-form textarea { min-height: 120px; resize: vertical; }

/* Empty states */
.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
}
.empty-state-icon { font-size: 2rem; display: block; margin-bottom: 0.6rem; opacity: 0.5; }
.empty-state p { font-size: 0.88rem; line-height: 1.65; font-weight: 400; }

/* Pending approval screen */
.pending-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem; position: relative; z-index: 1;
}
.pending-card {
  background: var(--forest-card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 3rem 2rem; text-align: center;
  max-width: 440px; width: 100%;
}
.pending-card-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.pending-card h2 { font-size: 1.4rem; color: var(--cream); margin-bottom: 0.75rem; }
.pending-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.7; font-weight: 400; }

/* ══════════════════════════════════════
   ADMIN COMPONENTS
   ══════════════════════════════════════ */

.client-list { display: flex; flex-direction: column; gap: 0.5rem; }
.client-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 1.1rem; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; transition: border-color 0.2s;
}
.client-row:hover { border-color: rgba(201,149,74,0.3); }
.client-row.selected { border-color: var(--gold); background: var(--gold-glow); }
.client-info strong { display: block; font-size: 0.9rem; color: var(--cream); margin-bottom: 0.1rem; }
.client-info span { font-size: 0.75rem; color: var(--muted); }
.client-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge {
  padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  font-family: 'Nunito', sans-serif;
}
.badge-pending  { background: rgba(255,180,50,0.15); color: #ffb432; border: 1px solid rgba(255,180,50,0.3); }
.badge-approved { background: rgba(90,154,90,0.15);  color: var(--sage); border: 1px solid rgba(90,154,90,0.3); }
.badge-package  { background: rgba(201,149,74,0.12); color: var(--gold); border: 1px solid rgba(201,149,74,0.25); }

.admin-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.admin-form { display: flex; flex-direction: column; gap: 0.85rem; }
.admin-form label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-light); display: block; margin-bottom: 0.25rem; }

/* ── Loading spinner ── */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(201,149,74,0.15);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap { text-align: center; padding: 3rem; }
.loading-wrap p { color: var(--muted); font-size: 0.85rem; margin-top: 0.75rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle { display: flex; }

  .portal-main {
    margin-left: 0;
  }

  .portal-header { padding: 5rem 1.25rem 0; }
  .portal-content { padding: 1.25rem 1.25rem 4rem; }

  .admin-panel-grid { grid-template-columns: 1fr; }
  .package-features { grid-template-columns: 1fr; }
  .upgrades-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ── Overlay for mobile sidebar ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 49;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }
