/* =====================================================================
   Confidentia — identidad visual sobre frappe-ui / Frappe
   Paleta «Editorial Calm» de confidentia.health (src/styles/theme.css):
   crema #f4efe4, papel #faf7ee, tinta #1c2515, verde #3d5a2c,
   terracota #c46b3d, filetes #d9d1bd. Newsreader (titulares) + Inter.
   ---------------------------------------------------------------------
   frappe-ui (LMS) pinta todo con variables semánticas: --surface-*,
   --ink-*, --outline-*. Los botones "solid" y los estados seleccionados
   usan la rampa gris oscura (gray-7..gray-9): la teñimos con la tinta
   verde de la marca y llevamos los fondos al crema de la web.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --cf-bg: #f4efe4;
  --cf-paper: #faf7ee;
  --cf-ink: #1c2515;
  --cf-ink-soft: #3d4032;
  --cf-muted: #6b6855;
  --cf-rule: #d9d1bd;
  --cf-rule-soft: #e6dec9;
  --cf-accent: #3d5a2c;
  --cf-warm: #c46b3d;
  --cf-serif: 'Newsreader', Georgia, serif;
  --cf-sans: 'Inter', system-ui, sans-serif;

  /* Botones principales, chips activos, toggles: tinta verde oscura */
  --surface-gray-7: var(--cf-ink);
  --surface-gray-8: var(--cf-accent);
  --surface-gray-9: #141b0f;
  --surface-alpha-gray-7: rgba(28, 37, 21, 0.9);
  --surface-alpha-gray-8: rgba(28, 37, 21, 0.95);

  /* Fondos cálidos como la web */
  --surface-white: var(--cf-paper);
  --surface-cards: var(--cf-paper);
  --surface-modal: var(--cf-paper);
  --surface-menu-bar: var(--cf-bg);
  --surface-sidebar: var(--cf-bg);
  --surface-gray-1: var(--cf-bg);
  --surface-gray-2: var(--cf-rule-soft);

  /* Texto */
  --ink-gray-9: var(--cf-ink);
  --ink-gray-8: var(--cf-ink-soft);
  --ink-gray-6: var(--cf-muted);

  /* Bordes y foco */
  --outline-gray-1: var(--cf-rule-soft);
  --outline-gray-2: var(--cf-rule);
  --outline-gray-5: var(--cf-ink);
  --outline-gray-6: var(--cf-accent);

  /* Rampa azul de frappe-ui -> verde Confidentia (enlaces, badges, progreso) */
  --surface-blue-6: var(--cf-accent);
  --surface-blue-7: #2f4722;
  --ink-blue-3: var(--cf-accent);
  --ink-blue-4: #2f4722;
  --outline-blue-3: var(--cf-accent);
}

[data-theme='dark'] {
  --surface-gray-7: #e8dfc9;
  --surface-gray-8: #f4efe4;
  --surface-gray-9: #ffffff;
  --surface-white: #161b11;
  --surface-cards: #161b11;
  --surface-modal: #1c2515;
  --surface-menu-bar: #12160e;
  --surface-sidebar: #12160e;
  --surface-gray-1: #1c2515;
  --surface-gray-2: #242e1c;
  --ink-gray-9: #f4efe4;
  --ink-gray-8: #e6dec9;
  --ink-gray-6: #b5ad97;
  --outline-gray-1: #242e1c;
  --outline-gray-2: #2f3a25;
  --outline-gray-5: #e8dfc9;
  --outline-gray-6: #f4efe4;
  --ink-blue-3: #a9c48f;
  --ink-blue-4: #c3d9ad;
}

body {
  font-family: var(--cf-sans);
}

/* ---- Titulares en serif, como la web ------------------------------ */
h1,
h2,
.text-2xl.font-semibold,
.text-3xl.font-semibold,
.text-xl.font-semibold {
  font-family: var(--cf-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---- Enlaces ------------------------------------------------------ */
a:not([class]) {
  color: var(--cf-accent);
}
[data-theme='dark'] a:not([class]) {
  color: #a9c48f;
}

/* ---- Barra de progreso de cursos (LMS) en terracota --------------- */
.progress-bar,
[role='progressbar'] > div,
.bg-surface-gray-7.rounded-full {
  background-color: var(--cf-warm);
}

/* ---- Escritorio clásico de Frappe (/app) -------------------------- */
:root {
  --primary: var(--cf-ink);
  --primary-color: var(--cf-ink);
  --btn-primary: var(--cf-ink);
  --navbar-bg: var(--cf-paper);
  --sidebar-select-color: var(--cf-rule-soft);
  --checkbox-color: var(--cf-ink);
  --checkbox-focus-shadow: 0 0 0 2px rgba(28, 37, 21, 0.25);
}
.btn-primary {
  background-color: var(--cf-ink) !important;
  border-color: var(--cf-ink) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--cf-accent) !important;
  border-color: var(--cf-accent) !important;
}
.navbar .navbar-brand img,
.app-logo {
  max-height: 28px;
}

/* ---- Páginas web clásicas (/login, /signup, /update-password) ----
   login.bundle.css se carga después y redefine --btn-primary; !important
   en la propiedad personalizada garantiza que gane el color de marca. */
:root {
  --btn-primary: var(--cf-ink) !important;
  --btn-primary-hover: var(--cf-accent) !important;
}
body.for-login,
body.for-signup,
body.for-forgot {
  background: var(--cf-bg);
}
.es-button,
.es-button:not(.es-button-secondary) {
  background-color: var(--cf-ink) !important;
  border-color: var(--cf-ink) !important;
  color: var(--cf-bg) !important;
  border-radius: 0 !important;
}
.es-button:hover {
  background-color: var(--cf-accent) !important;
}
.page-card,
.for-login .page-card {
  background: var(--cf-paper);
  border-top: 4px solid var(--cf-warm);
  border-radius: 0;
}
.page-card-head h4 {
  font-family: var(--cf-serif);
  font-weight: 500;
}
.for-login .page-card-head img,
.for-signup .page-card-head img {
  max-height: 40px;
}
