/* FanaGaam — signature geometric backgrounds
   Scoped visual layers only. Uses the existing html[data-theme] switch.
   No page content, interaction, assessment logic, navigation or footer styling is changed. */

:root,
html[data-theme="light"] {
  --fg-bg-surface: #F4F7F9;
  --fg-bg-ink: #142B3B;
  --fg-bg-teal: #087E83;
  --fg-bg-turquoise: #55BFC0;
  --fg-bg-gold: #C9964B;
  --fg-bg-layer-opacity: .96;
}

html[data-theme="dark"] {
  --fg-bg-surface: #081522;
  --fg-bg-ink: #142B3B;
  --fg-bg-teal: #20A6A5;
  --fg-bg-turquoise: #42C5C0;
  --fg-bg-gold: #D8AA66;
  --fg-bg-layer-opacity: .9;
}

/* LANDING — logo-derived geometric motifs continue through the full page.
   SVG paths are constrained to the outer gutters; copy, cards and hero art stay clear. */
.public-landing {
  background-color: var(--fg-bg-surface);
}

.public-landing::before {
  background:
    radial-gradient(ellipse at 18% 34%, color-mix(in srgb, var(--fg-bg-turquoise) 13%, transparent), transparent 39%),
    radial-gradient(ellipse at 12% 88%, color-mix(in srgb, var(--fg-bg-teal) 8%, transparent), transparent 42%);
}

.public-landing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("assets/backgrounds/landing-gutter-light.svg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
  opacity: 1;
}

html[data-theme="dark"] .public-landing::after {
  background-image: url("assets/backgrounds/landing-gutter-dark.svg");
}

html[data-theme="dark"] .public-landing::before {
  background:
    radial-gradient(ellipse at 18% 34%, rgba(66,197,192,.11), transparent 39%),
    radial-gradient(ellipse at 12% 88%, rgba(32,166,165,.09), transparent 42%);
}

/* LOGIN — quieter arcs at the outer edges; the existing card remains untouched. */
.auth-screen {
  isolation: isolate;
  background: linear-gradient(135deg, #F4F7F9 0%, #EAF1F4 100%);
}

html[data-theme="dark"] .auth-screen {
  background: linear-gradient(135deg, #081522 0%, #102432 100%);
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/backgrounds/login-light.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: .78;
}

html[data-theme="dark"] .auth-screen::before {
  background-image: url("assets/backgrounds/login-dark.svg");
  opacity: .7;
}

.auth-screen > .auth-top-left-actions,
.auth-screen > .auth-back-btn {
  /* Keep login navigation controls above the centered card on small screens. */
  z-index: 2;
}

.auth-screen > .auth-card {
  z-index: 1;
}

/* INTERNAL SYSTEM — one quiet, non-repeating geometric composition behind the existing workspace. */
.mesh-bg {
  background:
    radial-gradient(ellipse at 14% 12%, rgba(8,126,131,.048), transparent 43%),
    radial-gradient(ellipse at 86% 82%, rgba(85,191,192,.036), transparent 48%),
    radial-gradient(ellipse at 52% 46%, rgba(201,150,75,.012), transparent 54%);
}

html[data-theme="dark"] .mesh-bg {
  background:
    radial-gradient(ellipse at 14% 12%, rgba(32,166,165,.062), transparent 43%),
    radial-gradient(ellipse at 86% 82%, rgba(66,197,192,.046), transparent 48%),
    radial-gradient(ellipse at 52% 46%, rgba(216,170,102,.016), transparent 54%);
}

.grid-overlay {
  background-image: url("assets/backgrounds/internal-light.svg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: .36;
  mask-image: none;
  -webkit-mask-image: none;
}

html[data-theme="dark"] .grid-overlay {
  background-image: url("assets/backgrounds/internal-dark.svg");
  opacity: .25;
}

/* Responsive tuning: preserve the motif while reducing its visual weight. */
@media (max-width: 767px) {
  .public-landing::after {
    background-image: url("assets/backgrounds/landing-gutter-mobile-light.svg");
    background-size: 100% 100%;
    background-position: center top;
    opacity: .85;
  }

  html[data-theme="dark"] .public-landing::after {
    background-image: url("assets/backgrounds/landing-gutter-mobile-dark.svg");
    opacity: .82;
  }

  .auth-screen::before {
    background-size: auto 100%;
    background-position: 44% center;
    opacity: .70;
  }

  html[data-theme="dark"] .auth-screen::before {
    opacity: .58;
  }

  .grid-overlay {
    background-image: url("assets/backgrounds/internal-mobile-light.svg");
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: .32;
  }

  html[data-theme="dark"] .grid-overlay {
    background-image: url("assets/backgrounds/internal-mobile-dark.svg");
    opacity: .23;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-landing::before,
  .public-landing::after,
  .auth-screen::before,
  .mesh-bg,
  .grid-overlay {
    transition: none !important;
    animation: none !important;
  }
}
