/* Everything Stage website. The approved app supplies the branding and layout.
   This local integration applies the owner-requested neutral black/charcoal surfaces. */
:root {
  --es-bg: #080808;
  --es-panel: #121212;
  --es-panel-soft: #1a1a1a;
  --es-border: rgba(56, 139, 253, 0.22);
  --es-border-strong: rgba(56, 139, 253, 0.45);
  --es-input-border: #66788e;       /* >= 3:1 against both adjacent dark surfaces, unfocused */
  --es-blue: #1687ff;
  --es-blue-strong: #0f6fe0;          /* fill behind white text: 4.8:1 (WCAG AA) */
  --es-blue-strong-hover: #0a66d0;
  --es-cyan: #42c8ff;
  --es-gold: #f6b739;
  --es-green: #3ccf91;
  --es-text: #f8fbff;
  --es-muted: #8ea4bd;
  --es-danger: #ff8a8a;
  --es-glow: 0 0 0 1px rgba(66, 200, 255, 0.06), 0 8px 28px -12px rgba(22, 135, 255, 0.35);
  --es-font: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--es-bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--es-bg);
  /* Gloss black with a faint overhead wash, like a stage before the rig comes up */
  background-image:
    radial-gradient(70rem 26rem at 50% -8rem, rgba(22, 135, 255, 0.16), transparent 70%),
    radial-gradient(40rem 18rem at 85% -6rem, rgba(124, 58, 237, 0.08), transparent 70%);
  background-repeat: no-repeat;
  color: var(--es-text);
  font-family: var(--es-font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--es-cyan); }
a:hover { color: var(--es-text); }

:focus-visible { outline: 2px solid var(--es-cyan); outline-offset: 2px; border-radius: 0.375rem; }

.es-wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.es-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.es-skip { position: absolute; left: 1rem; top: -3rem; z-index: 10; padding: 0.5rem 0.875rem; background: var(--es-blue-strong); color: #fff; border-radius: 0.5rem; }
.es-skip:focus { top: 1rem; color: #fff; }

/* Display type: Archivo pushed wide, like road-case stenciling */
.es-display { font-stretch: 118%; font-variation-settings: "wdth" 118; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }

.es-panel {
  background: linear-gradient(180deg, var(--es-panel-soft), var(--es-panel));
  border: 1px solid var(--es-border);
  border-radius: 0.875rem;
  box-shadow: var(--es-glow);
}

/* Panel header strip: the signature element, like a console scribble strip */
.es-strip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(180deg, rgba(22, 135, 255, 0.08), rgba(22, 135, 255, 0.02));
  border-bottom: 1px solid var(--es-border);
  color: var(--es-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}

.es-led {
  display: inline-block; flex: none;
  width: 0.4375rem; height: 0.4375rem; border-radius: 999px;
  background: var(--led, var(--es-cyan));
  box-shadow: 0 0 6px 1px var(--led, var(--es-cyan));
}

/* Buttons */
.es-button,
.es-crm-bridge-form button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0.625rem 1.25rem;
  border: 1px solid transparent; border-radius: 0.625rem;
  background: var(--es-blue-strong); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(66, 200, 255, 0.15), 0 10px 30px -14px rgba(22, 135, 255, 0.8);
}
.es-button:hover,
.es-crm-bridge-form button:hover { background: var(--es-blue-strong-hover); color: #fff; }
.es-button--ghost { background: transparent; border-color: var(--es-border-strong); color: var(--es-text); box-shadow: none; }
.es-button--ghost:hover { background: rgba(22, 135, 255, 0.1); }
.es-button--small { min-height: 2.375rem; padding: 0.4375rem 0.875rem; font-size: 0.875rem; }

/* Top bar */
.es-topbar { position: sticky; top: 0; z-index: 5; background: rgba(8, 8, 8, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--es-border); }
.es-topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-height: 3.5rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.es-logo img { height: 2.5rem; width: auto; }
.es-nav { display: flex; align-items: center; gap: 1.25rem; }
.es-nav a:not(.es-button) { color: var(--es-text); text-decoration: none; font-weight: 600; }
.es-nav a:not(.es-button):hover { color: var(--es-cyan); }

/* Hero */
.es-hero { padding: 4.5rem 0 3.5rem; text-align: center; }
.es-hero__inner { display: flex; flex-direction: column; align-items: center; }
.es-hero__wordmark { width: min(26rem, 82vw); margin-bottom: 1.75rem; filter: drop-shadow(0 0 32px rgba(22, 135, 255, 0.35)); }
.es-hero__title { margin: 0 0 1rem; font-size: clamp(1.75rem, 4.2vw, 3rem); max-width: 22ch; }
.es-hero__lead { margin: 0 0 2rem; max-width: 44rem; color: var(--es-muted); font-size: clamp(1rem, 1.6vw, 1.1875rem); }
.es-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* Search: "How can we help you?" */
.es-hero__search { width: 100%; max-width: 40rem; margin: 0 0 1.75rem; }
.es-search { width: 100%; text-align: left; }
.es-search__label { display: block; margin-bottom: 0.625rem; font-weight: 700; }
.es-search--large .es-search__label { font-size: clamp(1.25rem, 2.6vw, 1.625rem); text-align: center; }
.es-search__row { display: flex; gap: 0.5rem; }
/* The field's boundary comes from the one reviewed input rule (Newsletter section); these lay it out. */
.es-search .es-search__row .es-search__input { flex: 1; min-width: 0; width: auto; margin-top: 0; }
.es-search--large .es-search__row .es-search__input { min-height: 3.25rem; font-size: 1.0625rem; }
.es-search .es-search__row .es-search__input::placeholder { color: var(--es-muted); opacity: 1; }
.es-search--large .es-button { min-height: 3.25rem; }

/* Sections */
.es-section { padding: 3.5rem 0; }
.es-section__head { max-width: 44rem; margin-bottom: 2rem; }
.es-section__title { margin: 0 0 0.75rem; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.es-section__lead { margin: 0; color: var(--es-muted); }

/* Worlds */
.es-worlds { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.es-world { overflow: hidden; display: flex; flex-direction: column; }
.es-world__banner { aspect-ratio: 2 / 1; width: 100%; object-fit: cover; border-bottom: 1px solid var(--es-border); }
.es-world__body { padding: 1rem 1.125rem 1.25rem; }
.es-world__name { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.375rem; font-size: 1.0625rem; }
.es-world__desc { margin: 0; color: var(--es-muted); font-size: 0.9375rem; }

/* Account entry points (the app signs people in; the website only links there) */
.es-account { overflow: hidden; }
.es-account__body { display: grid; gap: 1.5rem; padding: 2rem 1.5rem; align-items: center; }
.es-account__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.es-account__dashboard { font-weight: 600; }
@media (min-width: 52rem) {
  .es-account__body { grid-template-columns: 1.2fr 1fr; padding: 2.5rem; }
  .es-account__actions { justify-content: flex-end; }
}

/* Newsletter signup (the CRM bridge's form, styled here) */
.es-signup { overflow: hidden; }
.es-signup__grid { display: grid; gap: 2rem; padding: 2rem 1.5rem; grid-template-columns: 1fr; }
.es-signup__intro p { margin: 0; color: var(--es-muted); max-width: 32rem; }
@media (min-width: 52rem) {
  .es-signup__grid { grid-template-columns: 1fr 1.1fr; padding: 2.5rem; align-items: start; }
}

.es-crm-bridge-form p { margin: 0 0 1rem; }
.es-crm-bridge-form label { font-weight: 600; }
.es-crm-bridge-form input[type="text"],
.es-crm-bridge-form input[type="email"],
.es-search input[type="search"] {
  width: 100%; margin-top: 0.375rem; min-height: 2.875rem; padding: 0.625rem 0.875rem;
  background: var(--es-panel); color: var(--es-text);
  border: 1px solid var(--es-input-border); border-radius: 0.625rem;
  font: inherit;
}
.es-crm-bridge-form input[type="text"]:focus,
.es-crm-bridge-form input[type="email"]:focus,
.es-search input[type="search"]:focus { border-color: var(--es-cyan); }
.es-crm-bridge-form label:has(input[type="checkbox"]) { display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400; color: var(--es-text); }
.es-crm-bridge-form input[type="checkbox"] { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.1875rem 0 0; accent-color: var(--es-blue); }
.es-crm-bridge-form button { width: 100%; }
@media (min-width: 36rem) { .es-crm-bridge-form button { width: auto; } }

.es-crm-bridge-message,
.es-newsletter-paused {
  margin: 0 0 1.25rem; padding: 0.875rem 1rem;
  border: 1px solid var(--es-border-strong); border-left-width: 4px; border-radius: 0.625rem;
  background: rgba(22, 135, 255, 0.08);
}
.es-crm-bridge-message[role="status"] { border-left-color: var(--es-green); }
.es-crm-bridge-message[role="alert"] { border-color: rgba(255, 138, 138, 0.45); border-left-color: var(--es-danger); background: rgba(255, 138, 138, 0.08); }
.es-newsletter-paused { border-left-color: var(--es-gold); }

/* The bridge supplies the outcome; the theme supplies only its presentation. */
.es-confirmation { max-width: 48rem; padding-top: clamp(1.5rem, 6vw, 4rem); padding-bottom: clamp(1.5rem, 6vw, 4rem); min-height: calc(100svh - 12rem); }
.es-confirmation__panel { overflow: hidden; }
.es-confirmation__content { padding: clamp(1.25rem, 4vw, 2.5rem); overflow-wrap: anywhere; }
.es-confirmation__content h1 { margin: 0 0 1.5rem; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.es-confirmation__message h2 { margin: 0 0 1rem; font-size: clamp(1.25rem, 3vw, 1.5rem); line-height: 1.25; }
.es-confirmation__message p { margin: 0 0 1rem; }
.es-confirmation__message { margin-bottom: 1.5rem; }
/* FluentCRM's default continue link has inline button styling. Keep custom text links as links. */
.es-confirmation__message a[style*="background-color"] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  background-color: var(--es-blue-strong) !important; color: var(--es-text) !important;
  border: 1px solid transparent !important; border-radius: 0.625rem !important;
  padding: 0.625rem 1.25rem !important; font-family: inherit !important; font-weight: 700 !important;
}
.es-confirmation__message a[style*="background-color"]:hover { background-color: var(--es-blue-strong-hover) !important; }

/* Plain pages (fallback template) */
.es-prose { max-width: 46rem; }
.es-prose p, .es-prose li { color: var(--es-text); }

/* Owner-curated network links, using the existing panel and colour tokens. */
.es-network { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.es-network__card { min-width: 0; padding: 1.25rem; overflow-wrap: anywhere; }
.es-network__title { margin: 0; font-size: 1.25rem; line-height: 1.4; }
.es-network__card p { margin: 0.75rem 0 0; color: var(--es-muted); }
.es-network__empty { color: var(--es-muted); }

/* Search results and not-found pages */
.es-results { max-width: 52rem; }
.es-results .es-search { margin: 0 0 2rem; }
.es-results__heading { margin: 2rem 0 1rem; font-size: 1.125rem; color: var(--es-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.es-results__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.es-results__item { padding: 1rem 1.25rem; overflow-wrap: anywhere; }
.es-results__title { margin: 0; font-size: 1.125rem; }
.es-results__item p { margin: 0.5rem 0 0; color: var(--es-muted); }
.es-results__empty { padding: 1.25rem; }
.es-results__empty p { margin: 0 0 1rem; }
.es-helpful { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-weight: 600; }
.es-results .navigation { margin-top: 1.5rem; }
.es-results .nav-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Footer */
.es-footer { margin-top: 2rem; padding: 2rem 0 2.5rem; border-top: 1px solid var(--es-border); color: var(--es-muted); font-size: 0.875rem; }
.es-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.es-footer__logo { height: 1.75rem; width: auto; }
.es-footer__copy { margin: 0; }
.es-footer__nav { margin-left: auto; }
.es-footer__nav ul { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }

/* Small screens: every primary link stays visible (Network must be reachable at every width),
   so the navigation takes its own full-width row and wraps. */
@media (max-width: 52rem) {
  .es-nav { width: 100%; flex-wrap: wrap; gap: 0.5rem 1rem; padding-bottom: 0.5rem; }
}
@media (max-width: 30rem) {
  .es-hero { padding-top: 3rem; }
  .es-search__row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
