/* ================================================================
   SimplE — RESKIN VISUAL (Ronda 4)
   Override CSS cargado despues de build/main.css en index.html.
   Se aplica sobre Ionic 3 sin recompilar Angular.
   Autor: Ronda 4, 2026-08-05.
   ================================================================ */

/* ---------- Hotfix Ronda 3.4: ocultar widget pergaminoNoticias ---------- */
.pergaminoNoticias {
  display: none !important;
}

/* ---------- Tipografia moderna (Inter) ---------- */
/* Self-hosted en assets/fonts/inter/. Falla graciosamente a system fonts si no carga. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter/Inter-Bold.woff2') format('woff2');
}

/* Aplicar Inter a toda la app (Ionic 3 hardcodea Roboto/Noto Sans/Segoe UI, hay que overrides fuertes) */
html, body, .ion-page, .toolbar-title, .toolbar-title-md, .toolbar-title-ios, .toolbar-title-wp,
.item, .item-md, .item-ios, .item-wp,
.button, .button-md, .button-ios, .button-wp,
.tab-button, .tabs-md .tab-button, .tabs-ios .tab-button,
.alert-title, .alert-title-md, .alert-title-ios,
.alert-message, .alert-message-md, .alert-message-ios,
.action-sheet-title, .list-header, .list-header-md, .list-header-ios,
.card-title, .card-content, .card-content-md, .card-content-ios,
.label, .label-md, .label-ios, .input, .input-md, .input-ios,
.select, .select-md, .select-ios, .picker-toolbar-cancel, .picker-toolbar-done,
.searchbar-input, .toast-message, .modal-wrapper, .popover-content,
h1, h2, h3, h4, h5, h6, p, div, span, button {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* ---------- Paleta unificada (elimina los 3 azules disparejos) ---------- */
:root {
  --sm-brand: #1B5293;
  --sm-brand-dark: #123f78;
  --sm-brand-soft: #eef3fa;
  --sm-line: #cdddef;
  --sm-line-soft: #e6eef7;
  --sm-text: #1f2937;
  --sm-muted: #6b7280;
  --sm-yellow: #f8c53a;
  --sm-ok: #0f7b3f;
  --sm-warn: #8a6d00;
  --sm-danger: #b42318;
}

/* Reemplazar Ionic default blue (#387ef5 / #4e8ef7) por brand en componentes visibles */
.toolbar-background-md, .toolbar-background-ios,
.toolbar-md-primary .toolbar-background-md,
.toolbar-ios-primary .toolbar-background-ios {
  background: var(--sm-brand) !important;
}
.toolbar-md-primary .toolbar-title-md,
.toolbar-md-primary .bar-button-md,
.toolbar-ios-primary .toolbar-title-ios,
.toolbar-ios-primary .bar-button-ios {
  color: #fff !important;
}
.tabs-md-primary .tab-button-md[aria-selected="true"],
.tabs-ios-primary .tab-button-ios[aria-selected="true"] {
  color: var(--sm-brand) !important;
}
.tabs-md-primary .tabbar,
.tabs-ios-primary .tabbar {
  border-top: 1px solid var(--sm-line) !important;
}

/* ---------- Botones modernos ---------- */
.button-md, .button-ios {
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
  text-transform: none !important;
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease !important;
}
.button-md:active, .button-ios:active {
  transform: scale(0.97) !important;
}
/* Botones "primary" del brand */
.button-md-primary, .button-ios-primary,
.button-md-appColor, .button-md-buttonColor, .button-md-buttonColorOld,
.button-ios-appColor, .button-ios-buttonColor, .button-ios-buttonColorOld {
  background-color: var(--sm-brand) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(27, 82, 147, .18) !important;
}
.button-md-primary:hover, .button-md-appColor:hover, .button-md-buttonColor:hover,
.button-md-buttonColorOld:hover {
  background-color: var(--sm-brand-dark) !important;
}
/* Botones outline / clear con brand */
.button-md-clear, .button-ios-clear,
.button-md-outline, .button-ios-outline {
  color: var(--sm-brand) !important;
}

/* ---------- Inputs y campos ---------- */
.item-md .item-inner, .item-ios .item-inner {
  border-bottom-color: var(--sm-line) !important;
}
.item-md-input.input-has-focus .item-inner,
.item-md.item-input-has-focus .item-inner {
  border-bottom: 2px solid var(--sm-brand) !important;
  box-shadow: none !important;
}
input, select, textarea {
  font-family: 'Inter', sans-serif !important;
}

/* ---------- Cards con sombra sutil MD3 ---------- */
.card, .card-md, .card-ios {
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06) !important;
  border: 1px solid var(--sm-line-soft) !important;
  overflow: hidden;
}
.card:hover, .card-md:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, .10), 0 2px 4px rgba(0, 0, 0, .06) !important;
}

/* ---------- List items con mas aire ---------- */
.item-md, .item-ios {
  padding-top: 2px;
  padding-bottom: 2px;
  transition: background-color .12s ease;
}
.item-md:active, .item-ios:active {
  background-color: var(--sm-brand-soft) !important;
}

/* ---------- List headers ---------- */
.list-header, .list-header-md, .list-header-ios,
.item-divider, .item-divider-md, .item-divider-ios {
  color: var(--sm-brand-dark) !important;
  font-weight: 600 !important;
  letter-spacing: 0.4px !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  background-color: transparent !important;
}

/* ---------- Alerts modernos ---------- */
.alert-wrapper, .alert-md .alert-wrapper, .alert-ios .alert-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18) !important;
}
.alert-title, .alert-title-md, .alert-title-ios {
  color: var(--sm-brand-dark) !important;
  font-weight: 700 !important;
}
.alert-button, .alert-button-md, .alert-button-ios {
  color: var(--sm-brand) !important;
  font-weight: 600 !important;
  text-transform: none !important;
}

/* ---------- Modals ---------- */
.modal-wrapper {
  border-radius: 14px !important;
}

/* ---------- Toast ---------- */
.toast-wrapper, .toast-md-wrapper, .toast-ios-wrapper {
  border-radius: 10px !important;
  font-weight: 500 !important;
}

/* ---------- Badges ---------- */
.badge, .badge-md, .badge-ios {
  border-radius: 999px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 3px 9px !important;
  letter-spacing: 0.3px !important;
}
.badge-md-primary, .badge-ios-primary {
  background-color: var(--sm-brand) !important;
}

/* ---------- Menu lateral (sidebar) ---------- */
.menu-inner, ion-menu-inner {
  background: #fff !important;
}
.menu-inner .item-md, .menu-inner .item-ios {
  --min-height: 48px;
}
.menu-inner .toolbar-background-md,
.menu-inner .toolbar-background-ios {
  background: var(--sm-brand) !important;
}

/* ---------- Loader ---------- */
.loading-wrapper, .loading-md .loading-wrapper, .loading-ios .loading-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18) !important;
}

/* ---------- Micro animaciones globales ---------- */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Scrollbar en desktop (no molesta en mobile) ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--sm-line);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--sm-brand);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Fondo de pantalla de login/presentacion (mas contraste) ---------- */
/* La pantalla usa perga_media.jpg con blur; le agregamos un overlay del brand para mejor contraste del texto */
page-presentacion .toolbar-background,
page-login .toolbar-background {
  background: transparent !important;
  box-shadow: none !important;
}

/* ---------- Detalles finales ---------- */
/* Suavizado de fuentes */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- iOS safe-area (notch / status bar) — Capacitor iOS + PWA instalada ---------- */
/* En navegador normal, env(safe-area-inset-top)=0 => estas reglas no afectan la web. */
ion-header .toolbar-ios:first-of-type,
ion-header .bar-ios:first-of-type {
  padding-top: calc(env(safe-area-inset-top, 0px) + 4px) !important;
  min-height: calc(44px + env(safe-area-inset-top, 0px)) !important;
}
ion-header .toolbar-ios:first-of-type .toolbar-background-ios,
ion-header .bar-ios:first-of-type .toolbar-background-ios {
  top: 0 !important;
}
/* Pantallas sin header explicito (splash / algunas vistas): margen top al content */
.platform-ios ion-content.no-header .scroll-content {
  padding-top: env(safe-area-inset-top, 0px) !important;
}
/* Home-indicator inferior en iPhones sin boton (por si el tab bar queda muy pegado) */
ion-footer .toolbar-ios:last-of-type,
.tabbar-ios {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
