/* Ministry of Finance theming over the Chainlit default theme.
   Official brand navy sampled from minfin.gov.gr logo assets: #243469. */
:root {
  --primary: #243469;
}

/* ---- App header: white like minfin.gov.gr, official logo, navy rule ---- */
#header, header {
  background-color: #ffffff !important;
  border-bottom: 3px solid #243469 !important;
}

/* primary buttons + user bubble in ministry navy */
button[type="submit"], .MuiButton-containedPrimary {
  background-color: #243469 !important;
}
[data-step-type="user_message"] .message-content,
.user-message {
  background-color: #e8ecf5 !important;
}

/* watermark off-brand for a gov pilot */
a[href*="chainlit"] { display: none !important; }

/* ---- Login page: two columns — form left, ministry-navy panel right ---- */
body:has(img[src*="favicon"]) { background: #ffffff !important; }

/* hide the default pink artwork, keep the (now ministry) header logo */
body:has(img[src*="favicon"]) img:not([src*="logo"]) { display: none !important; }

/* right panel: solid ministry navy with the white logo lockup */
body:has(img[src*="favicon"]) div:has(> img:not([src*="logo"])) {
  background: #243469 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}
body:has(img[src*="favicon"]) div:has(> img:not([src*="logo"]))::before {
  content: "";
  width: 290px; height: 70px;
  background-image: url("/public/minfin-logo-blue.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
body:has(img[src*="favicon"]) div:has(> img:not([src*="logo"]))::after {
  content: "Γενικό Λογιστήριο του Κράτους\AΨηφιακός Βοηθός govERP / ΛΠΓΚ — πιλοτική λειτουργία";
  white-space: pre-line;
  color: #ffffff;
  text-align: center;
  font-size: 14.5px; font-weight: 400; line-height: 2;
  letter-spacing: .02em;
  max-width: 400px;
  opacity: .92;
}

/* left column: formal form copy */
body:has(img[src*="favicon"]) h1 {
  visibility: hidden;
  position: relative;
  height: 60px;
}
body:has(img[src*="favicon"]) h1::before {
  content: "Ψηφιακός Βοηθός govERP / ΛΠΓΚ";
  visibility: visible;
  position: absolute; top: 0; left: 0; right: 0;
  text-align: center;
  font-size: 17px; font-weight: 600; white-space: nowrap;
  color: #243469;
}
body:has(img[src*="favicon"]) h1::after {
  content: "Σύνδεση εξουσιοδοτημένων χρηστών";
  visibility: visible;
  position: absolute; top: 30px; left: 0; right: 0;
  text-align: center;
  font-size: 13.5px; font-weight: 400;
  color: #505a5f;
}
body:has(img[src*="favicon"]) input { border-radius: 2px !important; }
/* focus ring in ministry navy instead of the theme pink */
body:has(img[src*="favicon"]) * {
  --tw-ring-color: rgba(36, 52, 105, .45) !important;
  --ring: 220 49% 28% !important;
}
body:has(img[src*="favicon"]) :focus-visible { outline-color: #243469 !important; }
body:has(img[src*="favicon"]) div:has(> input:focus) { border-color: #243469 !important; }
body:has(img[src*="favicon"]) button[type="submit"],
body:has(img[src*="favicon"]) form button:last-of-type {
  background-color: #243469 !important;
  color: #ffffff !important;
  border-radius: 2px !important;
  font-weight: 600;
}

/* ministry logo inside welcome message / readme: fixed 70px, no frame, no gap */
img[src*="minfin-logo"] {
  height: 70px !important;
  width: auto !important;
  max-width: 90% !important;
  object-fit: contain;
}
div:has(> img[src*="minfin-logo"]),
div:has(> div > img[src*="minfin-logo"]) {
  background: transparent !important;
  height: 70px !important;
  max-height: 70px !important;
  width: auto !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}

/* tool-step accordion headers («Χρησιμοποιήθηκε …»): smaller, muted */
h3.flex > button {
  font-size: 12.5px !important;
  font-weight: 400 !important;
  color: #6b7480 !important;
}
h3.flex > button svg { width: 14px !important; height: 14px !important; }

/* ministry navy as the app-wide accent (kills the default pink):
   Chainlit/shadcn theme runs on the --primary HSL variable */
:root, .dark, [data-theme] {
  --primary: 226 49% 28% !important;
  --ring: 226 49% 40% !important;
}
a { color: #243469; }

/* PDF/element side panel: turn the ambiguous back-arrow into a clear circular ✕
   pinned top-right of the panel */
aside:has(#side-view-content) { position: relative; }
aside:has(#side-view-content) button:has(path[d^="m12 19-7-7"]) {
  position: absolute !important;
  top: 10px; right: 10px; z-index: 40;
  width: 34px; height: 34px; padding: 0 !important;
  border-radius: 9999px !important;
  background: #243469 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
aside:has(#side-view-content) button:has(path[d^="m12 19-7-7"]) svg { display: none; }
aside:has(#side-view-content) button:has(path[d^="m12 19-7-7"])::after {
  content: "✕";
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
aside:has(#side-view-content) button:has(path[d^="m12 19-7-7"]):hover {
  background: #00234f !important;
}
