/* ============================================================
   Posigneo Theme for ERPNext / Frappe
   Replaces Inter → DM Sans and maps Posigneo color palette
   ============================================================ */

/* Section 1: DM Sans @font-face declarations */

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/assets/posigneo_theme/fonts/DMSans/DMSans-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   Section 2: CSS variable overrides — Posigneo palette
   ============================================================ */

:root,
[data-theme="light"] {
  /* Font stack */
  --font-stack: "DM Sans", "-apple-system", "BlinkMacSystemFont", "Segoe UI", sans-serif;

  /* Primary / brand (Posigneo green) */
  --primary: #01BF83;

  /* Gray palette — Posigneo warm blue-gray tones */
  --gray-50:  #F5F5F5;
  --gray-100: #F5F5F5;
  --gray-200: #E5E7EB;
  --gray-300: #D4D4D4;
  --gray-400: #A9B0C1;
  --gray-500: #7B8499;
  --gray-600: #677085;
  --gray-700: #556070;
  --gray-800: #424957;
  --gray-900: #222222;

  /* Green palette */
  --green-50:  #F3FBF9;
  --green-100: #E8F8F2;
  --green-200: #B3ECDA;
  --green-300: #7CDBBD;
  --green-400: #3DCF9F;
  --green-500: #01BF83;
  --green-600: #01A872;
  --green-700: #018D60;
  --green-800: #016B48;
  --green-900: #014D33;

  /* Red palette */
  --red-50:  #FFF5F5;
  --red-100: #FFE8E8;
  --red-200: #F4C0BE;
  --red-300: #EDA09F;
  --red-400: #E28886;
  --red-500: #D6312D;
  --red-600: #BC2B27;
  --red-700: #A12523;
  --red-800: #871F1D;
  --red-900: #611615;

  /* Blue palette */
  --blue-50:  #F0F4FF;
  --blue-100: #E0EAFF;
  --blue-200: #C0D5FF;
  --blue-300: #99BAFF;
  --blue-400: #6699FF;
  --blue-500: #0066FF;
  --blue-600: #0055D4;
  --blue-700: #0044AA;
  --blue-800: #003380;
  --blue-900: #002260;

  /* Yellow / Orange */
  --yellow-500: #FFB629;
  --orange-500: #FF7731;

  /* Focus rings */
  --focus-green:   0px 0px 0px 2px #7CDBBD;
  --focus-default: 0px 0px 0px 2px #D4D4D4;
}

/* ============================================================
   Section 3: Logo replacement
   Primary logos replaced via hooks (boot_session + Website Settings).
   CSS overrides here catch JS-rendered and fallback cases.
   ============================================================ */

/* Desk navbar logo — src set by boot_session hook */
.navbar-home img.app-logo {
  max-height: 28px;
  width: auto;
}

/* Login / forgot-password page logo — src set by Website Settings */
.page-card-head img.app-logo {
  max-height: 40px;
  width: auto;
}

/* Post-login transition splash (hardcoded in login.js — CSS content override) */
.centered.splash img {
  content: url("/assets/posigneo_theme/images/logo.svg");
  max-width: 120px !important;
  max-height: 120px !important;
  width: auto !important;
}

/* Fallback: any remaining app-logo img not covered by hooks */
img.app-logo[src*="erpnext-logo"],
img.app-logo[src*="frappe-framework-logo"] {
  content: url("/assets/posigneo_theme/images/logo.svg");
}

/* ============================================================
   Section 4: Web portal / login page overrides
   ============================================================ */

/* Login heading override */
.page-card-head h4 {
  font-size: 0 !important;
}
.page-card-head h4::after {
  content: "Posigneo ERP";
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

/* Login page navbar: hide "Home" text, show Posigneo logo via background */
body[data-path="login"] .navbar-brand span {
  display: none !important;
}
body[data-path="login"] .navbar-brand {
  background: url("/assets/posigneo_theme/images/logo.svg") no-repeat left center;
  background-size: contain;
  width: 120px;
  min-height: 32px;
}
