/* ═══════════════════════════════════════════════════════
   SKIPDELINE — SHARED STYLES
   ═══════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --leaf-900: #0a1f10;
  --leaf-700: #145c2e;
  --leaf-600: #1a8040;
  --leaf-500: #22aa55;
  --leaf-400: #34cc68;
  --leaf-300: #62db87;
  --leaf-200: #9eeabc;
  --leaf-100: #d5f7e4;

  --bg:        #f2f2f0;
  --bg-alt:    #e8e8e6;
  --surface:   #ffffff;
  --surface-2: #f7f7f5;
  --border:    #dcdcd8;
  --border-2:  #c8c8c4;
  --text:      #1a1a18;
  --text-2:    #4a4a47;
  --text-3:    #7a7a76;
  --header-bg: #1c1c1a;

  --accent:        var(--leaf-600);
  --accent-hover:  var(--leaf-700);
  --accent-subtle: var(--leaf-100);
  --accent-border: var(--leaf-300);
  --accent-text:   var(--leaf-700);

  --error:     #c0392b;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
  --t:         0.2s ease;
}

[data-theme="dark"] {
  --bg:        #131312;
  --bg-alt:    #1a1a18;
  --surface:   #1f1f1d;
  --surface-2: #252523;
  --border:    #2e2e2b;
  --border-2:  #3a3a37;
  --text:      #ededea;
  --text-2:    #b0b0ab;
  --text-3:    #787873;
  --header-bg: #0e0e0d;

  --accent:        var(--leaf-400);
  --accent-hover:  var(--leaf-300);
  --accent-subtle: var(--leaf-900);
  --accent-border: var(--leaf-700);
  --accent-text:   var(--leaf-300);

  --shadow:    0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
}

/* ── BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
}

main { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER / NAV ────────────────────────────────────── */
header {
  background: var(--header-bg);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.65rem;
  color: var(--leaf-400);
  letter-spacing: 3px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.logo small {
  color: rgba(255,255,255,0.3);
  font-size: 0.5rem;
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: -1px;
}

nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover { color: rgba(255,255,255,0.8); text-decoration: none; }
.nav-link.active { color: var(--leaf-400); background: rgba(52,204,104,0.1); }

.header-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--header-bg);
  padding: 28px 24px;
  text-align: center;
  margin-top: auto;
}

.foot-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--leaf-400);
  letter-spacing: 3px;
  margin-bottom: 5px;
}

footer p { font-size: 0.7rem; color: rgba(240,240,238,0.3); line-height: 1.7; }
footer a { color: rgba(240,240,238,0.45); }
footer a:hover { color: var(--leaf-400); }

/* ── SECTION HELPERS ─────────────────────────────────── */
.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: var(--accent);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.sec-h {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
}

.btn-full { width: 100%; justify-content: center; }

.btn-p { background: var(--accent); color: #fff; }
.btn-p:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,128,64,0.25); text-decoration: none; color: #fff; }
.btn-p:active { transform: none; box-shadow: none; }
.btn-p:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-g {
  background: none;
  color: var(--text-3);
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0;
}
.btn-g:hover { border-color: var(--border-2); color: var(--text-2); background: var(--surface-2); text-decoration: none; }

.btn-danger {
  background: rgba(192,57,43,0.08);
  color: #e57373;
  border: 1px solid rgba(192,57,43,0.22);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3px;
}
.btn-danger:hover { background: rgba(192,57,43,0.15); }

.btn-sm { padding: 7px 13px; font-size: 0.8rem; letter-spacing: 1px; }

/* ── FORM FIELDS ─────────────────────────────────────── */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.field label .req { color: var(--accent); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  -webkit-appearance: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,128,64,0.1);
  background: var(--surface);
}

.field input.err { border-color: var(--error); }
.field textarea { resize: vertical; min-height: 72px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.emsg { font-size: 0.68rem; color: var(--error); margin-top: 3px; display: none; }
.emsg.on { display: block; }

/* ── CARDS / SURFACES ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: background var(--t), border-color var(--t);
}

/* ── BADGE ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.badge-green  { background: rgba(52,204,104,0.1);  color: var(--accent); border: 1px solid var(--accent-border); }
.badge-gray   { background: var(--surface-2);       color: var(--text-3); border: 1px solid var(--border); }
.badge-red    { background: rgba(192,57,43,0.07);   color: #e57373;       border: 1px solid rgba(192,57,43,0.22); }
.badge-yellow { background: rgba(245,166,35,0.1);   color: #f5a623;       border: 1px solid rgba(245,166,35,0.3); }

/* ── MODAL OVERLAY ───────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.overlay.on { display: flex; animation: fu 0.2s ease; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  transition: background var(--t), border-color var(--t);
}

.modal h3 { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; color: var(--text); margin-bottom: 4px; letter-spacing: 0.5px; }
.modal > p { font-size: 0.76rem; color: var(--text-3); margin-bottom: 20px; line-height: 1.55; }

.m-actions { display: flex; gap: 8px; margin-top: 16px; }
.m-actions .btn { flex: 1; }
.m-cancel {
  flex: none !important; width: auto; padding: 12px 16px;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  font-family: 'DM Sans', sans-serif; font-size: 0.84rem;
  cursor: pointer; transition: all var(--t);
}
.m-cancel:hover { border-color: var(--border-2); color: var(--text-2); }

.m-err { font-size: 0.7rem; color: var(--error); margin-bottom: 10px; display: none; }
.m-err.on { display: block; }

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--text);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 0.76rem;
  font-family: 'Space Mono', monospace;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.on { transform: translateX(-50%) translateY(0); }

/* ── SPINNER ─────────────────────────────────────────── */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.spinner.on { display: block; }

/* ── ANIMATIONS ──────────────────────────────────────── */
@keyframes fu   { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nod  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ── PAGE CONTENT WRAPPER ────────────────────────────── */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 48px 24px; }
.page-wrap-sm { max-width: 640px; margin: 0 auto; padding: 48px 24px; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  nav .nav-link { font-size: 0.65rem; padding: 4px 7px; }
}

/* ════════════════════════════════════════════════════
   MOBILE & PWA ADDITIONS
   ════════════════════════════════════════════════════ */

/* ── HAMBURGER ───────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: background var(--t);
}
.hamburger:hover { background: rgba(255,255,255,0.1); }
.hamburger span {
  display: block;
  height: 1.5px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE NAV DRAWER ───────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 8px 0 16px;
  z-index: 99;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideDown 0.2s ease;
}
.mobile-nav.open { display: block; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.mobile-nav a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 13px 24px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all var(--t);
}
.mobile-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.mobile-nav a.active { color: var(--leaf-400); }

/* ── PWA INSTALL BANNER ──────────────────────────── */
.pwa-banner {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
  transition: background var(--t);
}
.pwa-banner.show { display: flex; }
.pwa-banner-icon { font-size: 1.4rem; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pwa-banner-sub   { font-size: 0.7rem; color: var(--text-3); margin-top: 1px; }
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-install-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t);
  white-space: nowrap;
}
.pwa-install-btn:hover { background: var(--accent-hover); }
.pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--t);
}
.pwa-dismiss-btn:hover { color: var(--text); }

/* ── iOS INSTALL INSTRUCTIONS ────────────────────── */
.ios-install-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}
.ios-install-modal.show { display: flex; }
.ios-install-sheet {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ios-install-sheet h3 { font-family:'Bebas Neue',sans-serif; font-size:1.4rem; color:var(--text); margin-bottom:4px; letter-spacing:0.5px; }
.ios-install-sheet p  { font-size:0.82rem; color:var(--text-3); margin-bottom:16px; line-height:1.6; }
.ios-step { display:flex; gap:12px; align-items:flex-start; margin-bottom:14px; }
.ios-step-num { width:24px; height:24px; border-radius:50%; background:var(--accent-subtle); border:1px solid var(--accent-border); display:flex; align-items:center; justify-content:center; font-size:0.72rem; font-weight:700; color:var(--accent-text); flex-shrink:0; }
.ios-step p { font-size:0.82rem; color:var(--text-2); line-height:1.5; margin:0; }
.ios-step strong { color:var(--text); }
.ios-close { width:100%; margin-top:16px; }

/* ── RESPONSIVE BREAKPOINTS ──────────────────────── */
@media (max-width: 640px) {
  /* Hide desktop nav, show hamburger */
  header nav { display: none; }
  .hamburger { display: flex; }

  /* Header tighter */
  header { padding: 0 14px; gap: 10px; }
  .logo { font-size: 1.4rem; letter-spacing: 2px; }

  /* Hero */
  .hero { padding: 36px 18px 44px; }
  .hero-stats { gap: 20px; }

  /* Sections */
  .how-sec, .order-sec { padding: 36px 16px; }
  .page-wrap, .page-wrap-sm { padding: 32px 16px; }

  /* Form card panels */
  .panel { padding: 20px 16px; }
  .panel-h { font-size: 1.4rem; }

  /* Progress bar labels */
  .ps { font-size: 0.48rem; padding: 10px 3px; }
  .ps .si { font-size: 0.78rem; }

  /* Buttons — bigger touch targets */
  .btn { padding: 14px 16px; font-size: 0.95rem; }
  .btn-g { padding: 13px 16px; }

  /* Fields */
  .field input, .field select, .field textarea { font-size: 1rem; padding: 12px 13px; }
  .field-row { grid-template-columns: 1fr; }

  /* Section titles */
  .sec-h { font-size: 1.7rem; }

  /* Admin grid */
  .oc-grid, .add-form-grid, .stats-row { grid-template-columns: 1fr; }

  /* Footer */
  footer { padding: 22px 18px; }

  /* Members grid */
  .members-grid { grid-template-columns: 1fr; }

  /* Areas grid */
  .areas-list { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .logo small { display: none; }
  .ps .si { font-size: 0.7rem; }
}

/* ── HAMBURGER LEFT OF THEME BTN ─────────────────── */
@media (max-width: 640px) {
  /* Push theme button to the right, keep hamburger snug next to logo */
  #hamburger-btn {
    margin-left: 8px;   /* small gap after logo */
    margin-right: auto; /* absorbs all remaining space, pins theme btn right */
    order: 2;
  }
  .logo   { order: 1; }
  header nav { order: 3; } /* already hidden, just explicit */
  .header-right { order: 4; }
}

/* ── HAMBURGER POSITION FIX ──────────────────────── */
@media (max-width: 640px) {
  header {
    justify-content: flex-start !important;
    gap: 8px !important;
  }
  #hamburger-btn {
    margin-left: 4px !important;
    margin-right: 0 !important;
    order: unset;
  }
  .header-right {
    margin-left: auto; /* pushes theme btn to far right */
  }
}
