/*
 * Public pages: the welcome page and the sign-in pages (layouts/app).
 * Quiet "liquid glass": frosted panels over a still, softly coloured
 * backdrop. NEPRA green is the only accent and nothing moves. Colours follow
 * the site theme, which theme-init.js sets on <html data-bs-theme> before the
 * first paint. Panels fall back to solid surfaces when the browser cannot blur
 * or the user asks for less transparency.
 */

:root,
[data-bs-theme="light"] {
  --wl-page: #edf1ee;
  --wl-surface: #ffffff;
  --wl-border: #dfe4e0;
  --wl-hairline: rgba(20, 60, 40, 0.12);
  --wl-input-border: #8a958f;
  --wl-field: rgba(255, 255, 255, 0.8);
  --wl-text: #1c2621;
  --wl-muted: #56635c;
  --wl-brand: #0b5a33;
  --wl-brand-hover: #08482a;
  --wl-brand-soft: rgba(11, 90, 51, 0.1);
  --wl-link: #0b5a33;
  --wl-on-brand: #ffffff;
  --wl-brand-ink: #0b3d24;
  --wl-brand-rule: rgba(11, 61, 36, 0.2);
  --wl-focus: rgba(11, 90, 51, 0.22);
  --wl-danger: #b42318;
  --wl-danger-soft: #fdecea;
  --wl-warning-soft: #fff6e0;
  --wl-warning-text: #7a4b00;

  --wl-glass: rgba(255, 255, 255, 0.5);
  --wl-glass-strong: rgba(255, 255, 255, 0.68);
  --wl-glass-rim: rgba(255, 255, 255, 0.9);
  --wl-glass-edge: rgba(20, 60, 40, 0.1);
  --wl-glass-shine: rgba(255, 255, 255, 0.95);
  --wl-glass-gloss: rgba(255, 255, 255, 0.5);
  --wl-glass-shadow: 0 1px 2px rgba(16, 42, 30, 0.05), 0 20px 44px -22px rgba(16, 42, 30, 0.28);

  --wl-aura-1: rgba(11, 90, 51, 0.3);
  --wl-aura-2: rgba(40, 140, 110, 0.22);
  --wl-aura-3: rgba(196, 160, 80, 0.2);
  --wl-aura-4: rgba(110, 160, 190, 0.18);
}

[data-bs-theme="dark"] {
  --wl-page: #0b1013;
  --wl-surface: #161d21;
  --wl-border: #263038;
  --wl-hairline: rgba(255, 255, 255, 0.08);
  --wl-input-border: #5d6b75;
  --wl-field: rgba(8, 12, 14, 0.45);
  --wl-text: #e4eae6;
  --wl-muted: #9aa8a0;
  --wl-brand: #267a4e;
  --wl-brand-hover: #2c8a59;
  --wl-brand-soft: rgba(63, 160, 108, 0.16);
  --wl-link: #7ccaa0;
  --wl-on-brand: #ffffff;
  --wl-brand-ink: #e8eee9;
  --wl-brand-rule: rgba(232, 238, 233, 0.18);
  --wl-focus: rgba(124, 202, 160, 0.28);
  --wl-danger: #f97066;
  --wl-danger-soft: rgba(249, 112, 102, 0.12);
  --wl-warning-soft: rgba(247, 181, 0, 0.12);
  --wl-warning-text: #f5c96b;

  --wl-glass: rgba(24, 32, 36, 0.5);
  --wl-glass-strong: rgba(22, 30, 34, 0.66);
  --wl-glass-rim: rgba(255, 255, 255, 0.11);
  --wl-glass-edge: rgba(0, 0, 0, 0.35);
  --wl-glass-shine: rgba(255, 255, 255, 0.14);
  --wl-glass-gloss: rgba(255, 255, 255, 0.06);
  --wl-glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 52px -24px rgba(0, 0, 0, 0.7);

  --wl-aura-1: rgba(38, 122, 78, 0.38);
  --wl-aura-2: rgba(24, 96, 110, 0.3);
  --wl-aura-3: rgba(150, 120, 60, 0.14);
  --wl-aura-4: rgba(60, 90, 140, 0.2);
}

:root {
  --wl-serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --wl-blur: blur(22px) saturate(170%);
  --wl-radius: 20px;
}

body.wl {
  margin: 0;
  background: var(--wl-page);
  color: var(--wl-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Still, softly coloured backdrop for the glass to sit on. */
body.wl::before {
  content: "";
  position: fixed;
  inset: -15vh 0; /* overscan so collapsing mobile toolbars never reveal an edge */
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vmax 32vmax at 8% 6%, var(--wl-aura-1), transparent 70%),
    radial-gradient(36vmax 30vmax at 92% 14%, var(--wl-aura-2), transparent 70%),
    radial-gradient(44vmax 34vmax at 74% 96%, var(--wl-aura-3), transparent 70%),
    radial-gradient(34vmax 28vmax at 4% 86%, var(--wl-aura-4), transparent 70%);
}

.wl a {
  color: var(--wl-link);
  text-decoration: none;
}

.wl a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wl a:focus-visible,
.wl button:focus-visible {
  outline: 2px solid var(--wl-brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.wl .container {
  max-width: 1140px;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---- Glass ------------------------------------------------------------------- */

.wl-header,
.wl-footer,
.wl-steps,
.wl-card,
.wl-disclaimer,
.wl-auth-card,
.wl-auth .card {
  background: var(--wl-glass);
  -webkit-backdrop-filter: var(--wl-blur);
  backdrop-filter: var(--wl-blur);
}

/* Floating panels: bright rim, top highlight, soft depth and a still diagonal sheen. */
.wl-steps,
.wl-card,
.wl-disclaimer,
.wl-auth-card,
.wl-auth .card {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--wl-glass-rim);
  border-radius: var(--wl-radius);
  box-shadow: inset 0 1px 0 var(--wl-glass-shine), 0 0 0 1px var(--wl-glass-edge), var(--wl-glass-shadow);
}

.wl-steps::before,
.wl-card::before,
.wl-disclaimer::before,
.wl-auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, var(--wl-glass-gloss) 0%, transparent 42%);
}

/* ---- Header ---------------------------------------------------------------- */

.wl-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--wl-glass-strong);
  border-top: 3px solid var(--wl-brand);
  border-bottom: 1px solid var(--wl-hairline);
  box-shadow: inset 0 -1px 0 var(--wl-glass-shine), 0 8px 24px -18px rgba(16, 42, 30, 0.35);
}

.wl-header .navbar {
  padding: 0.7rem 0;
}

/* Emblem + typeset name. The name is real text (not part of the logo image) so it stays crisp. */
.wl .wl-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--wl-brand-ink);
}

.wl .wl-brand:hover {
  text-decoration: none;
  color: var(--wl-brand-ink);
}

/*
 * NEPRA emblem (from nepra.org.pk/assets/img/nepra.png) printed in a single ink:
 * the image is used as a mask, so it takes the name's colour, deep green in
 * light mode, off-white in dark mode. If the mask cannot load, it is simply
 * not drawn.
 */
.wl-emblem {
  flex: none;
  width: 48px;
  height: 52px;
  background-color: var(--wl-brand-ink);
  -webkit-mask: url("../img/nepra-emblem-mask.png") center / contain no-repeat;
  mask: url("../img/nepra-emblem-mask.png") center / contain no-repeat;
}

@media (forced-colors: active) {
  .wl-emblem {
    forced-color-adjust: none;
    background-color: CanvasText;
  }
}

.wl-brand-rule {
  flex: none;
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--wl-brand-rule);
}

.wl-brand-name {
  display: flex;
  flex-direction: column;
  font-family: var(--wl-serif);
  font-variant: small-caps;
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.wl-nav {
  gap: 0.5rem;
}

.wl-nav .nav-link {
  color: var(--wl-text);
  font-weight: 500;
  padding: 0.45rem 0.75rem;
}

.wl-nav .nav-link:hover {
  color: var(--wl-brand);
  text-decoration: none;
}

[data-bs-theme="dark"] .wl-nav .nav-link:hover {
  color: var(--wl-link);
}

/* Small glass capsules: menu button and theme switch. */
.wl-menu,
.wl-theme {
  border: 1px solid var(--wl-glass-rim);
  border-radius: 999px;
  background: var(--wl-glass);
  box-shadow: inset 0 1px 0 var(--wl-glass-shine), 0 0 0 1px var(--wl-glass-edge);
  cursor: pointer;
}

.wl-menu {
  color: var(--wl-text);
  padding: 0.45rem 0.75rem;
  line-height: 1;
}

.wl-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--wl-muted);
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.wl-theme:hover,
.wl-menu:hover {
  color: var(--wl-text);
  background: var(--wl-glass-strong);
}

/* site-ux.js labels the button with the mode it switches to; match the icon to that label. */
[data-bs-theme="light"] .wl-theme i { --fa: "\f186"; }
[data-bs-theme="dark"] .wl-theme i { --fa: "\f185"; }

/* ---- Buttons ----------------------------------------------------------------- */

.wl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wl .wl-btn:hover {
  text-decoration: none;
}

/* Solid green with a soft liquid highlight across the top half. */
.wl .wl-btn-primary {
  background-color: var(--wl-brand);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 52%);
  color: var(--wl-on-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 14px -9px rgba(11, 90, 51, 0.55);
}

.wl .wl-btn-primary:hover {
  background-color: var(--wl-brand-hover);
  color: var(--wl-on-brand);
}

.wl .wl-btn-secondary {
  background: var(--wl-glass-strong);
  -webkit-backdrop-filter: var(--wl-blur);
  backdrop-filter: var(--wl-blur);
  border-color: var(--wl-glass-rim);
  color: var(--wl-text);
  box-shadow: inset 0 1px 0 var(--wl-glass-shine), 0 0 0 1px var(--wl-glass-edge);
}

.wl .wl-btn-secondary:hover {
  color: var(--wl-brand);
}

[data-bs-theme="dark"] .wl .wl-btn-secondary:hover {
  color: var(--wl-link);
}

.wl-nav .wl-btn {
  min-height: 38px;
  padding: 0.4rem 1.1rem;
}

/* ---- Hero -------------------------------------------------------------------- */

.wl-hero {
  padding: 4rem 0 1rem;
}

.wl-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.wl-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wl-brand);
}

[data-bs-theme="dark"] .wl-kicker {
  color: var(--wl-link);
}

.wl-hero h1 {
  margin: 0 0 1rem;
  font-family: var(--wl-serif);
  font-size: clamp(2.25rem, 1.8rem + 1.8vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--wl-text);
}

.wl-lead {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  font-size: 1.075rem;
  color: var(--wl-muted);
}

.wl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.wl-steps {
  padding: 1.6rem 1.6rem 0.6rem;
}

.wl-steps h2 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wl-muted);
}

.wl-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.9rem;
  padding: 0 0 1rem;
}

.wl-steps li + li {
  border-top: 1px solid var(--wl-hairline);
  padding-top: 1rem;
}

.wl-step-no {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--wl-brand-soft);
  box-shadow: inset 0 1px 0 var(--wl-glass-shine);
  color: var(--wl-brand);
  font-weight: 700;
  font-size: 0.9rem;
}

[data-bs-theme="dark"] .wl-step-no {
  color: var(--wl-link);
}

.wl-steps h3 {
  margin: 0.2rem 0 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--wl-text);
}

.wl-steps p {
  margin: 0;
  font-size: 0.925rem;
  color: var(--wl-muted);
}

/* ---- Content ----------------------------------------------------------------- */

.wl-main {
  padding: 2.5rem 0 3.5rem;
}

.wl-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.wl-card {
  padding: 1.75rem;
}

.wl-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--wl-text);
}

.wl-guidelines {
  margin: 0;
  padding-left: 1.25rem;
}

.wl-guidelines li {
  padding-left: 0.35rem;
  color: var(--wl-text);
}

.wl-guidelines li::marker {
  color: var(--wl-muted);
  font-weight: 600;
}

.wl-guidelines li + li {
  margin-top: 0.85rem;
}

.wl-aside {
  display: grid;
  gap: 1.75rem;
}

.wl-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-links li + li {
  border-top: 1px solid var(--wl-hairline);
}

.wl-links a {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: var(--wl-text);
}

.wl-links li:first-child a {
  padding-top: 0;
}

.wl-links a:hover {
  text-decoration: none;
}

.wl-links a:hover .wl-link-title {
  color: var(--wl-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wl-links i,
.wl-contact i {
  margin-top: 0.25rem;
  color: var(--wl-muted);
  text-align: center;
}

.wl-link-title {
  display: block;
  font-weight: 500;
  line-height: 1.4;
}

.wl-link-meta {
  display: block;
  font-size: 0.825rem;
  color: var(--wl-muted);
}

.wl-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.wl-contact li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
}

.wl-disclaimer {
  margin-top: 1.75rem;
  padding: 1.25rem 1.5rem 1.25rem 1.75rem;
  border-radius: 16px;
}

/* Thin green accent along the left edge, inset so it follows the rounded corners. */
.wl-disclaimer::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 3px;
  background: var(--wl-brand);
}

.wl-disclaimer h2 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wl-muted);
}

.wl-disclaimer p {
  margin: 0;
  font-size: 0.925rem;
  color: var(--wl-muted);
}

/* ---- Footer ------------------------------------------------------------------ */

.wl-footer {
  border-top: 1px solid var(--wl-hairline);
  box-shadow: inset 0 1px 0 var(--wl-glass-shine);
  padding: 1.25rem 0;
  font-size: 0.875rem;
  color: var(--wl-muted);
}

.wl-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.wl-footer p {
  margin: 0;
}

.wl-footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* ---- Sign-in pages (layouts/app) --------------------------------------------- */

body.wl-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wl-auth-main {
  flex: 1 0 auto;
  padding: 3.5rem 0 4rem;
}

.wl-auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 2.1rem 2rem 1.9rem;
  border-radius: 24px;
  background: var(--wl-glass-strong);
}

.wl-auth-card.wl-wide {
  max-width: 520px;
}

.wl-auth-card .wl-kicker {
  margin-bottom: 0.5rem;
}

.wl-auth-card h1 {
  margin: 0 0 0.5rem;
  font-family: var(--wl-serif);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--wl-text);
}

.wl-auth-sub {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: var(--wl-muted);
}

.wl-field {
  margin-bottom: 1.1rem;
}

.wl-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.wl-label-row a {
  font-size: 0.875rem;
}

.wl .form-label {
  margin-bottom: 0.35rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--wl-text);
}

.wl .form-control {
  background-color: var(--wl-field);
  border: 1px solid var(--wl-input-border);
  border-radius: 12px;
  color: var(--wl-text);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
}

.wl .form-control:focus {
  background-color: var(--wl-field);
  border-color: var(--wl-brand);
  box-shadow: 0 0 0 3px var(--wl-focus);
  color: var(--wl-text);
}

[data-bs-theme="dark"] .wl .form-control:focus {
  border-color: var(--wl-link);
}

.wl .form-control.is-invalid {
  border-color: var(--wl-danger);
}

.wl .form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--wl-danger-soft);
}

.wl .invalid-feedback {
  color: var(--wl-danger);
  font-size: 0.875rem;
}

.wl-hint {
  margin-top: 0.35rem;
  font-size: 0.825rem;
  color: var(--wl-muted);
}

.wl-auth-card .wl-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.wl-auth-alt {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--wl-hairline);
  font-size: 0.925rem;
  text-align: center;
  color: var(--wl-muted);
}

.wl-alert {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.925rem;
}

.wl-alert-success {
  background: var(--wl-brand-soft);
  color: var(--wl-text);
  border-left: 3px solid var(--wl-brand);
}

.wl-alert-warning {
  background: var(--wl-warning-soft);
  color: var(--wl-warning-text);
  border-left: 3px solid #d99a00;
}

/* Older sign-in views (confirm password, verify email) still use Bootstrap cards. */
.wl-auth .card {
  color: var(--wl-text);
}

.wl-auth .card-header {
  background: transparent;
  border-bottom: 1px solid var(--wl-hairline);
  font-weight: 600;
}

.wl-auth .btn-primary {
  background: var(--wl-brand);
  border-color: var(--wl-brand);
  border-radius: 999px;
  color: var(--wl-on-brand);
}

.wl-auth .btn-primary:hover {
  background: var(--wl-brand-hover);
  border-color: var(--wl-brand-hover);
}

.wl-auth .btn-link {
  color: var(--wl-link);
}

/* ---- Solid fallback ----------------------------------------------------------- */

/* No blur support, or the user asked for less transparency: use solid panels. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root,
  [data-bs-theme] {
    --wl-glass: var(--wl-surface);
    --wl-glass-strong: var(--wl-surface);
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root,
  [data-bs-theme] {
    --wl-glass: var(--wl-surface);
    --wl-glass-strong: var(--wl-surface);
    --wl-field: var(--wl-surface);
  }

  body.wl::before {
    display: none;
  }
}

/* ---- Small screens ----------------------------------------------------------- */

@media (max-width: 991.98px) {
  .wl-hero-grid,
  .wl-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wl-hero-grid {
    gap: 2rem;
  }
}

@media (max-width: 767.98px) {
  :root {
    --wl-radius: 18px;
  }

  .wl .wl-brand {
    gap: 10px;
  }

  .wl-emblem {
    width: 38px;
    height: 41px;
  }

  .wl-brand-name {
    font-size: 0.95rem;
  }

  .wl-nav {
    gap: 0.25rem;
    padding: 0.75rem 0 0.25rem;
    align-items: flex-start !important;
  }

  .wl-nav .nav-link {
    padding-left: 0;
  }

  .wl-hero {
    padding: 2.25rem 0 0.5rem;
  }

  .wl-main {
    padding: 1.75rem 0 2.5rem;
  }

  .wl-card {
    padding: 1.25rem;
  }

  .wl-actions .wl-btn {
    flex: 1 1 auto;
  }

  .wl-auth-main {
    padding: 1.5rem 0 2.5rem;
  }

  .wl-auth-card {
    padding: 1.6rem 1.25rem 1.4rem;
    border-radius: 20px;
  }
}
