/* style.css — Mon Investissement Locatif
 *
 * Reprend l'identité visuelle de la page d'accueil (bleu #1565C0, fond clair,
 * cartes à coins arrondis) et l'étend aux pages de guides et aux calculateurs.
 * Mobile d'abord : tout tient à partir de 320 px sans défilement horizontal.
 */

:root {
  --primary: #1565C0;
  --primary-dark: #0D47A1;
  --primary-light: #1E88E5;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-alt: #EEF3F9;
  --text: #212121;
  --text-secondary: #5A5A5A;
  --border: #E0E0E0;
  --border-strong: #C7D2DE;
  --positive: #1B6B3A;
  --positive-bg: #E8F5EC;
  --negative: #B3261E;
  --negative-bg: #FDECEA;
  --warning: #8A5300;
  --warning-bg: #FFF4E0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.12);
  --max-width: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- Navbar */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
}

.nav-links.open {
  display: flex;
}

.nav-links a {
  display: block;
  padding: 9px 4px;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary-dark);
  background: var(--surface-alt);
}

.nav-links .nav-cta {
  margin-top: 4px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 10px 16px;
}

.nav-links .nav-cta:hover {
  background: var(--primary-dark);
  color: #fff;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

@media (min-width: 720px) {
  .nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 6px;
    padding-bottom: 0;
  }

  .nav-links a {
    padding: 8px 10px;
  }

  .nav-links .nav-cta {
    margin-top: 0;
    margin-left: 6px;
  }

  .nav-toggle {
    display: none;
  }
}

/* ----------------------------------------------------------- Page header */

.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 40px 0 36px;
  text-align: center;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1rem;
  opacity: 0.95;
  max-width: 560px;
  margin: 0 auto;
}

/* ------------------------------------------------------------- Home hero */

.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 52px 0 46px;
  text-align: center;
}

.hero h1 {
  font-size: 1.75rem;
  line-height: 1.28;
  margin-bottom: 14px;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.94;
  max-width: 560px;
  margin: 0 auto 22px;
}

/* -------------------------------------------------------------- Contenu */

.page-content {
  padding: 26px 20px 48px;
}

.guide h2 {
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--primary-dark);
  margin: 34px 0 12px;
}

.guide h3 {
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 24px 0 8px;
}

.guide p,
.guide ul,
.guide ol {
  margin-bottom: 14px;
}

.guide ul,
.guide ol {
  padding-left: 22px;
}

.guide li {
  margin-bottom: 7px;
}

.guide-intro {
  font-size: 1.06rem;
  color: var(--text-secondary);
}

.formula {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  overflow-x: auto;
}

.notice {
  background: var(--warning-bg);
  border: 1px solid #E8C989;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 18px 0;
  font-size: 0.9rem;
  color: #4A3000;
}

.notice a {
  color: #6B3F00;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 18px 0;
  font-size: 0.95rem;
}

.callout strong {
  color: var(--primary-dark);
}

/* ----------------------------------------------------------- Fil d'Ariane */

.breadcrumb {
  margin-bottom: 18px;
  font-size: 0.86rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary-dark);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-secondary);
}

/* ---------------------------------------------------------- Calculateurs */

.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 18px 0 22px;
}

.calc-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .calc-fields {
    grid-template-columns: 1fr 1fr;
  }

  .calc-fields .field-wide {
    grid-column: 1 / -1;
  }
}

.calc-group-title {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  margin-top: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field label {
  font-size: 0.87rem;
  font-weight: 600;
}

.field .hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.field-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 9px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(21, 101, 192, 0.25);
  outline-offset: 0;
}

.field .unit {
  flex: 0 0 auto;
  font-size: 0.87rem;
  color: var(--text-secondary);
}

/* Résultats */

.calc-results {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.result-headline {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}

.result-headline .label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.result-headline .value {
  display: block;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
}

.result-headline .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.result-headline.is-positive {
  background: var(--positive-bg);
}

.result-headline.is-positive .value {
  color: var(--positive);
}

.result-headline.is-negative {
  background: var(--negative-bg);
}

.result-headline.is-negative .value {
  color: var(--negative);
}

.result-trio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .result-trio {
    grid-template-columns: repeat(3, 1fr);
  }
}

.result-card {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}

.result-card .label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.result-card .value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.result-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.93rem;
}

.result-rows li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.result-rows li:last-child {
  border-bottom: 0;
}

.result-rows .row-total {
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
  margin-top: 4px;
  padding-top: 9px;
}

.result-rows .row-label {
  color: var(--text-secondary);
}

.result-rows .row-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

.calc-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 14px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.badge-best {
  background: var(--positive-bg);
  color: var(--positive);
}

.badge-off {
  background: var(--negative-bg);
  color: var(--negative);
}

/* -------------------------------------------------------------- Tableaux */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table caption {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table thead th {
  background: var(--surface-alt);
  color: var(--primary-dark);
  font-size: 0.82rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .is-best {
  background: var(--positive-bg);
}

/* ------------------------------------------------------------------- FAQ */

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.faq summary {
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding: 0 14px 13px;
  margin: 0;
  font-size: 0.95rem;
}

/* -------------------------------------------------------- Guides / liens */

.guides {
  padding: 34px 0 10px;
}

.guides h2 {
  font-size: 1.35rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.guides-intro {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  list-style: none;
  padding: 0;
}

@media (min-width: 620px) {
  .guides-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.guides-grid a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.guides-grid a:hover,
.guides-grid a:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.guides-grid strong {
  display: block;
  color: var(--primary-dark);
  font-size: 1.03rem;
  margin-bottom: 4px;
}

.guides-grid span {
  display: block;
  font-size: 0.89rem;
  color: var(--text-secondary);
}

.related {
  margin-top: 34px;
}

.related h2 {
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.related ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0;
  margin: 0;
}

@media (min-width: 620px) {
  .related ul {
    grid-template-columns: 1fr 1fr;
  }
}

.related li {
  margin: 0;
}

.related a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.related a:hover,
.related a:focus-visible {
  border-color: var(--primary-light);
}

.related a span {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ------------------------------------------------------- Fonctionnalités */

.features {
  padding: 36px 0 10px;
}

.features h2 {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 24px;
  color: var(--primary-dark);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 620px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.feature-card h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------- CTA */

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-white {
  background: #fff;
  color: var(--primary-dark);
}

.btn-white:hover {
  background: #E8F0FB;
  color: var(--primary-dark);
}

.btn-lg {
  padding: 15px 28px;
  font-size: 1.02rem;
}

.cta-app {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  margin: 36px 0 22px;
  text-align: center;
}

.cta-app h2 {
  color: #fff;
  font-size: 1.25rem;
  margin: 0 0 8px;
}

.cta-app p {
  opacity: 0.95;
  margin-bottom: 18px;
  font-size: 0.97rem;
}

.cta-section {
  text-align: center;
  padding: 34px 0 10px;
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* ---------------------------------------------------------------- Footer */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 20px;
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  display: inline-block;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 0;
  margin: 0 0 14px;
}

.footer-links a {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.89rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------- Divers */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
