@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap");

/* EuroMudra Brand Tokens & LibreChat Theme Integration */
:root {
  --em-dark: #141413;
  --em-light: #faf9f5;
  --em-mid: #b0aea5;
  --em-soft: #e8e6dc;
  --em-orange: #d97757;
  --em-orange-deep: #b54f2f;
  --em-blue: #6a9bcc;
  --em-blue-deep: #386999;
  --em-green: #788c5d;
  --em-green-deep: #53663a;
  --em-card: #fffdf8;
  --em-border: #ddd9cc;
  --em-subtle: #646158;

  /* Typography & Radius Tokens */
  --theme-font-family: "Poppins", Inter, system-ui, -apple-system, sans-serif;
  --theme-display-font-family: "Poppins", Inter, system-ui, -apple-system, sans-serif;
  --theme-control-radius: 0.75rem;
  --theme-surface-radius: 1rem;
  --theme-large-surface-radius: 1rem;
  --theme-menu-radius: 0.75rem;
  --theme-popover-radius: 1rem;
  --theme-menu-panel-radius: 0.75rem;
  --theme-compact-panel-radius: 0.75rem;
  --theme-auth-control-radius: 1rem;
  --theme-auth-action-radius: 0.75rem;
  --theme-radius-lg: 0.75rem;
  --theme-radius-xl: 0.75rem;
  --theme-radius-2xl: 1rem;
  --theme-radius-3xl: 1rem;
}

/* Warm EuroMudra Light Mode Defaults (yields to high-contrast accessibility modes) */
html:not(.dark):not(.high-contrast) {
  --text-primary: 20 20 19;
  --text-secondary: 61 60 53;
  --text-secondary-alt: 100 97 88;
  --text-tertiary: 100 97 88;
  --text-muted: 100 97 88;
  --surface-primary: 250 249 245;
  --surface-primary-alt: 245 243 236;
  --surface-primary-contrast: 232 230 220;
  --surface-secondary: 255 253 248;
  --surface-secondary-alt: 232 230 220;
  --surface-tertiary: 232 230 220;
  --surface-tertiary-alt: 255 253 248;
  --surface-dialog: 255 253 248;
  --surface-chat: 255 253 248;
  --surface-composer: 255 253 248;
  --surface-card: 255 253 248;
  --surface-card-hover: 240 237 228;
  --surface-sidebar: 245 243 236;
  --surface-canvas: 250 249 245;
  --surface-user-message: 232 230 220;
  --surface-hover: 232 230 220;
  --surface-hover-alt: 221 217 204;
  --surface-active: 232 230 220;
  --surface-active-alt: 221 217 204;
  --surface-nav-hover: 232 230 220;
  --surface-nav-selected: 232 230 220;
  --surface-menu: 255 253 248;
  --surface-popover: 255 253 248;
  --surface-search: 240 237 228;
  --surface-code: 245 243 236;
  --surface-code-body: 255 253 248;
  --surface-code-inline: 232 230 220;
  --header-primary: 250 249 245;
  --header-hover: 232 230 220;
  --header-button-hover: 232 230 220;
  --presentation: 255 253 248;
  --page-canvas: 250 249 245;
  --border-light: 221 217 204;
  --border-medium: 205 200 186;
  --border-medium-alt: 205 200 186;
  --border-heavy: 176 174 165;
  --border-xheavy: 100 97 88;
  --border-control: 176 174 165;
  --border-menu: 221 217 204;
  --accent-primary: 181 79 47;
  --accent-primary-hover: 152 63 36;
  --link: 56 105 153;
  --link-hover: 41 82 122;
  --link-prose: 56 105 153;
  --surface-submit: 217 119 87;
  --surface-submit-hover: 196 98 66;
  --surface-inverted: 20 20 19;
  --surface-inverted-hover: 48 47 44;
  --button-primary: 217 119 87;
  --button-primary-hover: 196 98 66;
  --text-inverted: 255 250 245;
  --focus-control: 217 119 87;
  --border-field-focus: 217 119 87;
}

/* Warm EuroMudra Dark Mode Defaults (yields to high-contrast accessibility modes) */
html.dark:not(.high-contrast) {
  --text-primary: 250 249 245;
  --text-secondary: 232 230 220;
  --text-secondary-alt: 176 174 165;
  --text-tertiary: 176 174 165;
  --text-muted: 176 174 165;
  --surface-primary: 20 20 19;
  --surface-primary-alt: 27 27 25;
  --surface-primary-contrast: 35 34 32;
  --surface-secondary: 35 34 32;
  --surface-secondary-alt: 44 43 40;
  --surface-tertiary: 44 43 40;
  --surface-tertiary-alt: 54 52 48;
  --surface-dialog: 27 27 25;
  --surface-chat: 44 43 40;
  --surface-composer: 44 43 40;
  --surface-card: 35 34 32;
  --surface-card-hover: 44 43 40;
  --surface-sidebar: 27 27 25;
  --surface-canvas: 20 20 19;
  --surface-user-message: 44 43 40;
  --surface-hover: 54 52 48;
  --surface-hover-alt: 68 66 60;
  --surface-active: 68 66 60;
  --surface-active-alt: 54 52 48;
  --surface-nav-hover: 44 43 40;
  --surface-nav-selected: 54 52 48;
  --surface-menu: 35 34 32;
  --surface-popover: 35 34 32;
  --surface-search: 35 34 32;
  --surface-code: 27 27 25;
  --surface-code-body: 20 20 19;
  --surface-code-inline: 54 52 48;
  --header-primary: 27 27 25;
  --header-hover: 44 43 40;
  --header-button-hover: 44 43 40;
  --presentation: 35 34 32;
  --page-canvas: 20 20 19;
  --border-light: 46 45 41;
  --border-medium: 68 66 60;
  --border-medium-alt: 68 66 60;
  --border-heavy: 100 97 88;
  --border-xheavy: 158 155 145;
  --border-control: 100 97 88;
  --border-menu: 54 52 48;
  --accent-primary: 217 119 87;
  --accent-primary-hover: 230 140 110;
  --link: 106 155 204;
  --link-hover: 139 179 219;
  --link-prose: 106 155 204;
  --surface-submit: 217 119 87;
  --surface-submit-hover: 230 140 110;
  --surface-inverted: 250 249 245;
  --surface-inverted-hover: 232 230 220;
  --button-primary: 217 119 87;
  --button-primary-hover: 230 140 110;
  --text-inverted: 20 20 19;
  --focus-control: 217 119 87;
  --border-field-focus: 217 119 87;
}

/* Keep the dark-ink EuroMudra wordmark legible in dark mode */
html.dark:not(.high-contrast) img[src*="assets/logo.svg"] {
  filter: invert(0.92) hue-rotate(180deg) brightness(1.06);
}

/* Typography: Poppins for UI chrome, headings, buttons, nav & labels */
body,
h1,
h2,
h3,
h4,
h5,
h6,
button,
[role="button"],
nav,
label,
input,
textarea,
select,
.btn,
.custom-btn {
  font-family: "Poppins", Inter, system-ui, -apple-system, sans-serif;
}

/* Typography: Lora for message prose and comfortable long-form reading */
.message-content,
.prose {
  font-family: "Lora", Georgia, serif;
}

.message-content :is(h1, h2, h3, h4, h5, h6, button, label),
.prose :is(h1, h2, h3, h4, h5, h6, button, label) {
  font-family: "Poppins", Inter, system-ui, -apple-system, sans-serif;
}

.message-content :is(code, pre, kbd, samp, .hljs),
.prose :is(code, pre, kbd, samp, .hljs) {
  font-family: var(--theme-mono-font-family, "Roboto Mono", ui-monospace, monospace);
}

/* Subtle 12px / 16px border-radius polish matching EuroMudra cards and buttons */
.btn,
.custom-btn,
.select-item {
  border-radius: 12px;
}

.popover-ui,
.popover-animate,
.toast-root .alert-root {
  border-radius: 16px;
}

/* Clean, responsive styling for footer & welcome links back to euromudra.com */
[role="contentinfo"] a[href*="euromudra.com"],
.relative.w-full a[href*="euromudra.com"],
main a[href*="euromudra.com"] {
  font-family: "Poppins", Inter, system-ui, -apple-system, sans-serif;
  font-weight: 500;
  color: rgb(var(--accent-primary));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgb(var(--accent-primary) / 0.45);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

[role="contentinfo"] a[href*="euromudra.com"]:hover,
.relative.w-full a[href*="euromudra.com"]:hover,
main a[href*="euromudra.com"]:hover {
  color: rgb(var(--accent-primary-hover));
  text-decoration-color: rgb(var(--accent-primary-hover));
}
