/* =========================================================
   RM Modules — Finances Intelligentes
   ========================================================= */

:root {
  --rm-navy: #1c1e4f;
  --rm-purple: #6b2c6e;
  --rm-olive: #6e6b33;
  --rm-gold: #c9a227;
  --rm-serif: 'Noto Serif', Georgia, serif;
}

/* ---------- Header page (hero) ---------- */
.rm-hero {
  position: relative;
  min-height: var(--rm-hero-h, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: var(--rm-hero-bg, none) center / cover no-repeat var(--rm-navy);
  overflow: hidden;
}
.rm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(28, 30, 79, var(--rm-hero-overlay, .78));
}
.rm-hero__inner {
  position: relative;
  padding: 40px 20px 120px;
}
.rm-hero .rm-hero__title {
  margin: 0 0 40px !important;
  font: 500 clamp(48px, 7vw, 82px)/1.1 var(--rm-serif) !important;
  color: #fff !important;
  letter-spacing: .01em;
}
.rm-hero p.rm-hero__text {
  margin: 0 !important;
  font: italic 600 clamp(16px, 1.6vw, 21px)/1.8 var(--rm-serif) !important;
  color: #fff !important;
}
.rm-hero a.rm-hero__down {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 140px;
  height: 104px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}
.rm-hero__down svg {
  width: 38px;
  height: 38px;
  transition: transform .25s;
}
.rm-hero__down:hover svg { transform: translateY(5px); }

/* ---------- Header accueil (tuiles) ---------- */
.rm-module {
  max-width: 1200px;
  margin: 0 auto;
}
.rm-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}
.rm-module a.rm-tile,
.rm-module a.rm-tile * {
  text-decoration: none !important;
  box-shadow: none !important;
}
.rm-module a.rm-tile {
  --rm-tile-color: var(--rm-navy);
  --rm-tile-opacity: .7;
  --rm-tile-accent: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: clamp(240px, 27vw, 330px);
  padding: 30px 20px 0;
  overflow: hidden;
  text-align: center;
  color: #fff !important;
  background: var(--rm-tile-color);
  isolation: isolate;
}
.rm-module a.rm-tile--large { grid-column: span 3; }
.rm-module a.rm-tile--small { grid-column: span 2; }

.rm-module a.rm-tile--navy   { --rm-tile-color: #1c1e4f; --rm-tile-opacity: .68; }
.rm-module a.rm-tile--purple { --rm-tile-color: #8b2a83; --rm-tile-opacity: .78; }
.rm-module a.rm-tile--olive  { --rm-tile-color: #b3a41f; --rm-tile-opacity: .8; }
.rm-module a.rm-tile--gold   { --rm-tile-accent: var(--rm-gold); }

.rm-tile__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: center / cover no-repeat;
  transition: transform .6s ease;
}
.rm-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--rm-tile-color);
  opacity: var(--rm-tile-opacity);
  transition: opacity .35s;
}
.rm-tile:hover .rm-tile__img { transform: scale(1.05); }
.rm-tile:hover::before { opacity: calc(var(--rm-tile-opacity) - .12); }

.rm-module .rm-tile__title {
  margin: 0 !important;
  font: 500 clamp(28px, 3vw, 40px)/1.1 var(--rm-serif) !important;
  color: var(--rm-tile-accent) !important;
  text-transform: lowercase;
}

/* Losange avec chevron */
.rm-tile__icon {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rm-tile-accent);
}
.rm-tile__icon::before {
  content: "";
  position: absolute;
  width: 21px;
  height: 21px;
  border: 1.6px solid currentColor;
  transform: rotate(45deg);
  transition: background .25s;
}
.rm-tile__icon svg {
  position: relative;
  width: 7px;
  height: 10px;
  transition: color .25s;
}
.rm-tile:hover .rm-tile__icon::before { background: var(--rm-tile-accent); }
.rm-tile:hover .rm-tile__icon svg { color: var(--rm-tile-color); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .rm-module a.rm-tile--large { grid-column: span 6; }
  .rm-module a.rm-tile--small { grid-column: span 3; }
}
@media (max-width: 600px) {
  .rm-hero { min-height: min(var(--rm-hero-h, 620px), 480px); }
  .rm-hero p.rm-hero__text br { display: none; }
  .rm-hero a.rm-hero__down { width: 100px; height: 76px; }
  .rm-module a.rm-tile--large,
  .rm-module a.rm-tile--small { grid-column: span 6; min-height: 220px; }
}
