/* ==========================================================================
   HomeEasyBudget — static site — single stylesheet (FR + EN)
   ========================================================================== */

:root {
  --brand:        #1e73be;
  --brand-dark:   #185c98;
  --green:        #7ab929;
  --text:         #2b2f38;
  --muted:        #6b7280;
  --bg:           #ffffff;
  --bg-alt:       #f5f7fa;
  --border:       #e5e8ee;
  --shadow:       0 6px 24px rgba(0, 0, 0, .08);
  --radius:       12px;
  --maxw:         1140px;
  --f1:           #911eb4;
  --f2:           #00bcd4;
  --f3:           #4caf50;
  --f4:           #5ca2df;
  --f5:           #e0a800;
  --f6:           #6b7280;
  --f7:           #f58231;
  --f8:           #e91e63;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Navbar --------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 16px;
}
.navbar-brand img { width: 240px; height: auto; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 2px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  margin-inline-start: auto;
  padding: 0;
}
.nav-menu > li > a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 500;
  border-radius: 8px;
}
.nav-menu > li > a:hover { background: var(--bg-alt); color: var(--brand); }

/* language switcher (flag dropdown) */
.lang {
  position: relative;
  margin-inline-start: 8px;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--border);
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  text-transform: uppercase;
}
.lang-toggle:hover { background: var(--bg-alt); color: var(--brand); border-color: var(--brand); }
.lang-caret {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: var(--muted);
  transition: transform .15s ease;
}
.lang-caret svg { width: 100%; height: 100%; display: block; }
.lang.open .lang-caret { transform: rotate(180deg); }

.lang-flag {
  display: inline-block;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
  flex: none;
}
.lang-flag svg { height: 14px; width: auto; display: block; }

.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 80;
  display: none;
  max-height: min(60vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lang.open .lang-menu { display: block; }
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.lang-menu a:hover { background: var(--bg-alt); color: var(--brand); }
.lang-menu a.active { color: var(--brand); font-weight: 700; }
.lang-menu a .lang-flag { height: 16px; }
.lang-menu a .lang-flag svg { height: 16px; }

/* ---------- Hero / banner -------------------------------------------------- */
.hero {
  background: var(--bg-alt);
  padding: 64px 0 56px;
  text-align: center;
}
.hero-title {
  margin: 0;
  font-size: clamp(30px, 5.5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
  text-transform: uppercase;
  color: var(--brand);
}
.hero-title span { display: block; color: var(--green); }
.hero-tagline {
  max-width: 620px;
  margin: 18px auto 0;
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text);
}

/* ---------- Section -------------------------------------------------------- */
.section { padding: 56px 0; }
.section-title {
  text-align: center;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}

/* CTA row */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 28px 0 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid var(--brand);
  transition: all .15s ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }

.cta-store { display: flex; justify-content: center; margin: 28px 0 0; }
.btn-store { padding: 0; border: none; border-radius: 12px; line-height: 0; transition: transform .15s ease; }
.btn-store img { height: 54px; width: auto; display: block; }
.btn-store:hover { transform: translateY(-2px); }

.free-note {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  margin: 6px 0 0;
}

/* ---------- Features grid -------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-alt);
  margin-bottom: 14px;
}
.feature .icon svg { width: 32px; height: 32px; }
.feature:nth-child(1) .icon svg { stroke: var(--f1); }
.feature:nth-child(2) .icon svg { stroke: var(--f2); }
.feature:nth-child(3) .icon svg { stroke: var(--f3); }
.feature:nth-child(4) .icon svg { stroke: var(--f4); }
.feature:nth-child(5) .icon svg { stroke: var(--f5); }
.feature:nth-child(6) .icon svg { stroke: var(--f6); }
.feature:nth-child(7) .icon svg { stroke: var(--f7); }
.feature:nth-child(8) .icon svg { stroke: var(--f8); }
.feature h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.feature .arrow { color: var(--brand); margin-inline-start: 4px; }

/* ---------- Screenshots ---------------------------------------------------- */
.shots {
  background: var(--bg-alt);
}
.shots-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-top: 36px;
}
.shots-grid a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.shots-grid a:hover { transform: translateY(-4px); }
.shots-grid img { width: 100%; }

/* ---------- Footer --------------------------------------------------------- */
.footer {
  background: #1b2330;
  color: #c7cfdb;
  padding: 30px 0;
  font-size: 14px;
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer a { color: #c7cfdb; }
.footer a:hover { color: #fff; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- Legal / content pages ------------------------------------------ */
.legal {
  max-width: 820px;
  margin: 0 auto;
}
.legal h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  margin: 0 0 24px;
  color: var(--text);
}
.legal h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 10px;
  color: var(--text);
}
.legal h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text);
}
.legal p { margin: 0 0 16px; }
.legal ul { margin: 0 0 16px; padding-inline-start: 22px; }
.legal li { margin: 0 0 8px; }
.legal a { word-break: break-word; }
.legal .btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }
.legal .muted { color: var(--muted); font-size: 14px; }

.legal .note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--brand);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
}
.legal .note p:last-child { margin-bottom: 0; }

.legal .table-wrap { overflow-x: auto; margin: 18px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th,
.legal td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.legal thead th {
  background: var(--bg-alt);
  color: var(--brand-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.legal tbody tr:last-child td { border-bottom: none; }

/* ---------- Online help hub ------------------------------------------------ */
.help-intro {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}
.help-group { max-width: 900px; margin: 44px auto 0; }
.help-group > h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.help-list li { margin: 0; }
.help-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.help-list a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
  color: var(--brand);
}
.help-list a .arrow { margin-inline-start: auto; color: var(--brand); font-weight: 700; }

/* "back to help" link on article pages */
.legal .back {
  display: inline-block;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 700px) {
  .help-list { grid-template-columns: 1fr; }
}

/* screenshots inside help articles */
.legal figure.shot {
  margin: 18px 0;
  text-align: center;
}
.legal figure.shot a { display: inline-block; max-width: 100%; line-height: 0; }
.legal figure.shot img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

/* ---------- Lightbox ------------------------------------------------------- */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, .9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.lb-overlay.open { display: flex; }
.lb-overlay img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .12);
  border: 0;
  color: #fff;
  font-size: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-prev { inset-inline-start: 20px; }
.lb-next { inset-inline-end: 20px; }
.lb-close { top: 22px; inset-inline-end: 22px; transform: none; }

/* ---------- Scroll to top -------------------------------------------------- */
.scrollup {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  z-index: 60;
  font-size: 20px;
}
.scrollup.show { display: flex; }
.scrollup:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Cookie bar ----------------------------------------------------- */
.cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
  padding: 14px 20px;
  display: none;
  z-index: 120;
}
.cookie-bar.show { display: block; }
.cookie-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.cookie-bar p { margin: 0; font-size: 14px; color: var(--muted); }
.cookie-bar .btn { padding: 9px 20px; font-size: 14px; }

/* ---------- Responsive ----------------------------------------------------- */
@media (max-width: 992px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .shots-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 16px 16px;
  }
  .nav-menu.open { display: flex; }
  .nav-toggle { margin-inline-start: auto; }
  .lang { margin: 0; padding: 0; border: 0; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .shots-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar-brand img { width: 180px; }
}