:root {
  --fg-yellow: #dbf508;
  --fg-black: #171717;
  --fg-upperbar: #42454a;
  --fg-page: #eef0f2;
  --fg-surface: #ffffff;
  --fg-border: #dfe1e3;
  --fg-text: #171717;
  --fg-muted: #61666c;
  --fg-hero: #252525;
  --fg-success-bg: #e4f5ea;
  --fg-success-text: #176b3a;
  --fg-warning-bg: #fff0d9;
  --fg-warning-text: #9a5300;
  --fg-neutral-bg: #eceef0;
  --fg-neutral-text: #525860;
  --fg-radius: 16px;
  --fg-radius-sm: 12px;
  --fg-font: Inter, system-ui, "Segoe UI", Arial, sans-serif;
  --fg-shadow: 0 8px 24px rgba(23, 23, 23, 0.08);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fg-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-text);
  background: var(--fg-page);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--fg-yellow);
  color: var(--fg-black);
}

:focus-visible {
  outline: 2px solid var(--fg-yellow);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.fg-btn {
  font: inherit;
}

.fg-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.fg-upperbar {
  height: 68px;
  background: var(--fg-black);
  color: #f5f6f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.fg-brand img {
  height: 28px;
  width: auto;
  display: block;
}

.fg-brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.fg-brand-meta strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.fg-brand-meta span {
  font-size: 12px;
  color: rgba(245, 246, 247, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fg-upperbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fg-env {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
  color: rgba(245, 246, 247, 0.78);
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.fg-env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-yellow);
}

.fg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fg-hero {
  position: relative;
  isolation: isolate;
  color: #f5f6f7;
  padding: 2.4rem 1.5rem 2.1rem;
  background-color: var(--fg-black);
  background-image:
    linear-gradient(180deg, rgba(23, 23, 23, 0.55) 0%, rgba(23, 23, 23, 0.28) 45%, rgba(23, 23, 23, 0.72) 100%),
    url("../assets/fulgard-auth-bg.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.fg-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}

.fg-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fg-hero p {
  margin: 0;
  max-width: 52rem;
  color: rgba(245, 246, 247, 0.78);
  font-size: 15px;
}

.fg-hero-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.35rem;
}

.fg-content {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2rem;
}

.fg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.fg-toolbar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.fg-toolbar p {
  margin: 0.2rem 0 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.fg-search {
  position: relative;
  min-width: min(100%, 280px);
}

.fg-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--fg-border);
  border-radius: 999px;
  background: var(--fg-surface);
  padding: 0 1rem 0 2.45rem;
  color: var(--fg-text);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.05);
}

.fg-search input::placeholder {
  color: #8a9097;
}

.fg-search svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  pointer-events: none;
}

.fg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.fg-area {
  appearance: none;
  border: 1px solid var(--fg-border);
  background: var(--fg-surface);
  border-radius: 20px;
  box-shadow: var(--fg-shadow);
  text-align: left;
  padding: 1.1rem 1.1rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 176px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  color: inherit;
}

.fg-area:hover {
  border-color: #c9ced3;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 23, 23, 0.12);
}

.fg-area:active {
  transform: translateY(0);
}

.fg-area.is-online {
  border-color: rgba(183, 196, 0, 0.55);
  box-shadow: inset 4px 0 0 var(--fg-yellow), 0 10px 26px rgba(23, 23, 23, 0.1);
}

.fg-area-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.fg-area-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.fg-area-tag {
  margin: 0.25rem 0 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.fg-area-desc {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  flex: 1;
}

.fg-area-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.fg-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.fg-pill-online {
  background: var(--fg-success-bg);
  color: var(--fg-success-text);
}

.fg-pill-offline {
  background: var(--fg-warning-bg);
  color: var(--fg-warning-text);
}

.fg-pill-scaffold {
  background: var(--fg-neutral-bg);
  color: var(--fg-neutral-text);
}

.fg-area-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-text);
}

.fg-area-cta span {
  color: var(--fg-muted);
  font-weight: 500;
}

.fg-empty {
  display: none;
  border: 1px dashed var(--fg-border);
  background: var(--fg-surface);
  border-radius: 20px;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--fg-muted);
}

.fg-empty.is-visible {
  display: block;
}

.fg-footer {
  padding: 1rem 1.5rem 1.5rem;
  color: var(--fg-muted);
  font-size: 12px;
  text-align: center;
}

/* Drawer / area access panel */
.fg-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 23, 23, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.fg-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--fg-surface);
  border-left: 1px solid var(--fg-border);
  box-shadow: -8px 0 24px rgba(23, 23, 23, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.fg-drawer.is-open {
  transform: translateX(0);
}

.fg-drawer-head {
  background-color: var(--fg-black);
  background-image:
    linear-gradient(180deg, rgba(23, 23, 23, 0.82) 0%, rgba(23, 23, 23, 0.55) 100%),
    url("../assets/fulgard-auth-bg.jpg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  color: #f5f6f7;
  padding: 1.25rem 1.25rem 1.1rem;
}

.fg-drawer-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.fg-drawer-head p {
  margin: 0.45rem 0 0;
  color: rgba(245, 246, 247, 0.76);
}

.fg-drawer-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(245, 246, 247, 0.85);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.fg-drawer-body {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
  overflow: auto;
}

.fg-meta {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-sm);
  background: var(--fg-page);
}

.fg-meta dt {
  margin: 0;
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 600;
}

.fg-meta dd {
  margin: 0.15rem 0 0;
  font-size: 13px;
  word-break: break-all;
}

.fg-actions {
  display: grid;
  gap: 0.65rem;
}

.fg-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}

.fg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fg-btn[hidden],
[hidden] {
  display: none !important;
}

.fg-btn-primary {
  background: var(--fg-yellow);
  color: var(--fg-black);
}

.fg-btn-primary:hover:not(:disabled) {
  filter: brightness(0.97);
}

.fg-btn-secondary {
  background: var(--fg-surface);
  border-color: var(--fg-border);
  color: var(--fg-text);
}

.fg-btn-secondary:hover:not(:disabled) {
  background: #f7f8f9;
}

.fg-note {
  margin: 0;
  font-size: 13px;
  color: var(--fg-muted);
}

@media (max-width: 720px) {
  .fg-upperbar {
    padding: 0 1rem;
  }

  .fg-brand-meta span {
    display: none;
  }

  .fg-hero,
  .fg-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .fg-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .fg-search {
    min-width: 100%;
  }
}

/* Area workspace shell */
.fg-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.fg-sidebar {
  background: var(--fg-black);
  color: #f5f6f7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.fg-sidebar-brand,
.fg-area-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 0.15rem;
  align-items: center;
  width: max-content;
  max-width: 100%;
}

.fg-sidebar-brand {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fg-sidebar-brand .fg-brand-mark,
.fg-area-brand .fg-brand-mark {
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 42px;
  width: auto;
  align-self: center;
}

.fg-sidebar-brand .fg-brand-name,
.fg-sidebar-brand .fg-brand-wordmark,
.fg-area-brand .fg-brand-name,
.fg-area-brand .fg-brand-wordmark {
  grid-column: 2;
  grid-row: 1;
  display: block;
  height: 22.5px; /* +25% */
  width: auto;
  max-width: 100%;
  align-self: end;
}

.fg-area-brand-label,
.fg-brand-area {
  grid-column: 2;
  grid-row: 2;
  display: block;
  padding: 0;
  border: 0;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--fg-yellow);
  white-space: nowrap;
  line-height: 1.1;
  align-self: start;
}

.fg-upperbar .fg-area-brand .fg-brand-mark {
  height: 36px;
}

.fg-nav {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.65rem;
}

.fg-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: rgba(245, 246, 247, 0.82);
  font-size: 13px;
  font-weight: 500;
}

.fg-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.fg-nav a.is-active {
  background: rgba(219, 245, 8, 0.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--fg-yellow);
}

.fg-sidebar-foot {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fg-sidebar-foot a {
  color: rgba(245, 246, 247, 0.8);
  font-size: 13px;
  font-weight: 600;
}

.fg-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fg-workspace .fg-upperbar {
  position: sticky;
}

.fg-panel {
  background: var(--fg-surface);
  border: 1px solid var(--fg-border);
  border-radius: 20px;
  box-shadow: var(--fg-shadow);
  padding: 1.15rem 1.2rem;
}

.fg-panel h3 {
  margin: 0 0 0.55rem;
  font-size: 15px;
  font-weight: 600;
}

.fg-panel p,
.fg-panel dd {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.fg-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.fg-workspace .fg-hero {
  padding: 1.5rem 1.5rem 1.35rem;
}

.fg-workspace .fg-content {
  padding-top: 1.15rem;
}

@media (max-width: 900px) {
  .fg-app {
    grid-template-columns: 1fr;
  }

  .fg-sidebar {
    position: relative;
    height: auto;
  }

  .fg-nav {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

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

.fg-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #f5f6f7;
  font-size: 0.88rem;
}

.fg-btn-ghost {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #f5f6f7;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}

.fg-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.fg-auth-gate {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.fg-auth-gate-stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 2.4rem 1rem 3rem;
  background-color: #171717;
  background-image:
    linear-gradient(180deg, rgba(23, 23, 23, 0.42) 0%, rgba(23, 23, 23, 0.18) 40%, rgba(23, 23, 23, 0.58) 100%),
    url("../assets/fulgard-auth-bg.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.fg-auth-panel {
  width: min(440px, 94vw);
  background: #fff;
  border-radius: 20px;
  padding: 1.15rem 1.35rem 1.35rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fg-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
  background: #eceef0;
  border-radius: 999px;
  padding: 0.25rem;
}

.fg-auth-tab {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--fg-muted);
}

.fg-auth-tab.is-active {
  background: #fff;
  color: var(--fg-black);
  box-shadow: 0 1px 3px rgba(23, 23, 23, 0.12);
}

.fg-auth-panel-body h1 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
}

.fg-auth-panel-body .sub {
  margin: 0 0 1.1rem;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.fg-form {
  display: grid;
  gap: 0.8rem;
}

.fg-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.fg-form input,
.fg-form select {
  font: inherit;
  border: 1px solid var(--fg-border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #fff;
}

.fg-auth-panel .fg-btn-primary {
  width: 100%;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  margin-top: 0.25rem;
}

.fg-auth-error {
  margin: 0.85rem 0 0;
  color: #a4262c;
  font-size: 0.88rem;
}

.fg-auth-error.is-ok {
  color: #176b3a;
}

.fg-auth-forgot {
  margin: 0.75rem 0 0;
  text-align: center;
}

.fg-auth-forgot-link {
  border: 0;
  background: transparent;
  color: var(--fg-muted, #61666c);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.fg-auth-forgot-link:hover {
  color: var(--fg-ink, #171717);
}

.fg-areas-section[hidden],
.fg-auth-gate[hidden],
.fg-auth-panel-body[hidden],
.fg-session-chip[hidden] {
  display: none !important;
}
