/* === WWF Portal — Styles === */
/* WWF colour scheme: white background, black text, orange + green highlights.   */
/* Light launcher; the footer is a dark band so the white AG Insights logo reads. */

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

:root {
  --bg:                #ffffff;
  --surface:           #ffffff;
  --border:            #e3e6e3;
  --text:              #16201a;   /* near-black */
  --muted:             #5d665f;   /* grey body/labels */

  --wwf-orange:        #f26c21;   /* WWF action orange */
  --wwf-green:         #009247;   /* WWF green */
  --accent-docs:       var(--wwf-orange);   /* Documents — orange (the primary action) */
  --accent-supporters: var(--wwf-green);    /* WWF Supporters — green */

  --footer-bg:         #0e1311;   /* dark footer band */
  --hero-gray:         #e8ebe8;   /* top of the header gradient (fades to white) */

  /* Consumed by ag-auth.js's injected sign-in / access-denied screens (step 3). */
  --primary:           #16201a;
  --agi-gradient:      linear-gradient(160deg, #ffffff 0%, #f2f5f2 100%);
}

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
}

#app { min-height: 100vh; }

/* ── Auth gate (loading) — shown from first byte, overwritten when auth resolves ── */
.agi-gate {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 2rem; text-align: center; z-index: 2000;
}
.agi-gate-logo { height: 96px; width: auto; }   /* black panda on white — no filter */
.agi-gate-bar {
  width: 220px; height: 3px; background: #e6e9e6;
  border-radius: 3px; overflow: hidden; position: relative;
}
.agi-gate-bar-fill {
  position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--wwf-orange), transparent);
  border-radius: 3px; animation: agi-sweep 1.4s ease-in-out infinite;
}
@keyframes agi-sweep { 0% { left: -60%; } 100% { left: 100%; } }
.agi-gate-label {
  font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Header ── */
header {
  background: linear-gradient(180deg, var(--hero-gray) 0%, var(--bg) 45%);
  padding: 3rem 3rem 3.5rem;
  min-height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.header-title-block {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.header-logo { height: 90px; width: auto; }   /* black panda on white — no filter */

.header-tagline {
  margin-top: 0.6rem;
  font-size: 0.82rem; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.header-right > span { font-size: 0.85rem; color: var(--text); }

/* ── Buttons (light) ── */
.btn-signout {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-signout:hover { border-color: #c9cfc9; background: #f7f8f7; }

/* ── Main ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1.25rem;
}
/* Orange underline accent — echoes the WWF.org section headings */
.section-label::after {
  content: '';
  display: block;
  width: 32px; height: 3px;
  margin-top: 0.5rem;
  background: var(--wwf-orange);
  border-radius: 2px;
}

/* ── App cards ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(20,32,26,0.04);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}

.app-card.docs::before       { background: var(--accent-docs); }
.app-card.supporters::before { background: var(--accent-supporters); }

.app-card:hover {
  border-color: #cfd4cf;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(20,32,26,0.10);
}

/* Disabled card — app not yet wired (e.g. "Coming soon") */
.app-card.disabled {
  pointer-events: none;
  opacity: 0.6;
  box-shadow: none;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-card-team {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.app-card.docs       .app-card-team { color: var(--accent-docs); }
.app-card.supporters .app-card-team { color: var(--accent-supporters); }

.app-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.app-card-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.app-card-desc {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.app-card-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-card.docs       .app-card-cta { color: var(--accent-docs); }
.app-card.supporters .app-card-cta { color: var(--accent-supporters); }

.app-card-cta-arrow { transition: transform 0.15s; }
.app-card:hover .app-card-cta-arrow { transform: translateX(3px); }

/* ── Footer (dark band: WWF + AG Insights logos) ── */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 0.875rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--footer-bg);
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logos img { height: 26px; width: auto; opacity: 0.9; }

.footer-version {
  position: absolute;
  right: 20px;
  font-size: 0.7rem;
  color: #8a948e;
}

/* ── ag-auth.js sign-in / access-denied overrides for the light theme (active in step 3) ──
   ag-auth.js hardcodes white text + a white button (built for a dark theme); these
   #app-scoped rules out-specify it so the sign-in screen reads on white. */
#app .agi-signin-screen h1,
#app .agi-access-denied h1 { color: var(--text); }
#app .agi-signin-screen p,
#app .agi-access-denied p { color: var(--muted); }
#app .agi-btn-signin { background: var(--wwf-orange); color: #fff; }
#app .agi-btn-signin:hover { opacity: 0.92; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  main { padding: 2.5rem 2rem 6rem; }
}

@media (max-width: 768px) {
  header { padding: 2.5rem 1.5rem 3rem; min-height: 150px; }
  .header-logo { height: 64px; }
  main { padding: 2rem 1.25rem 6rem; }
  .app-grid { grid-template-columns: 1fr; }
  .header-right { gap: 10px; }
  footer { padding: 0.875rem 1.25rem; }
  .footer-version { right: 1.25rem; }
}

@media (max-width: 480px) {
  .header-logo { height: 56px; }
  .header-right > span { display: none; }
  main { padding: 1.5rem 1rem 6rem; }
  .footer-logos img { height: 22px; }
}
