/* ============================================================
   ALLIADE HABITAT – Simulateur Fonds Energie
   ============================================================ */

/* ---- Polices (déposez vos fichiers dans fonts/) ---- */
@font-face {
  font-family: 'Gotham';
  src: url('fonts/Gotham-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Gotham';
  src: url('fonts/Gotham-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Gotham';
  src: url('fonts/Gotham-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Termina';
  src: url('fonts/Termina-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Gotham', Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  color: #222;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #1a3a6b; text-decoration: underline; }
a:hover { color: #e0194e; }

/* ---- Layout ---- */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

main.container { flex: 1; padding-top: 0; padding-bottom: 40px; }

/* ---- Header ---- */
.site-header {
  padding: 12px 0;
  border-bottom: 1px solid #e5e5e5;
}

.logo { height: 40px; display: block; }
.logo-text-main { font-size: 15px; font-weight: bold; color: #e0194e; }
.logo-icon { color: #e0194e; }
.logo-text-sub { font-size: 10px; color: #555; }

/* ---- Page title ---- */
.page-title-bar { padding: 24px 0 0; }
.page-title {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-family: 'Termina', 'Gotham', Arial, sans-serif;
  color: #e0194e;
  margin-bottom: 16px;
}
.title-separator { border: none; border-top: 1px solid #ccc; margin-bottom: 24px; }

/* ---- Screens ---- */
.screen { display: none; }
.screen.active { display: block; }

/* ---- Cards ---- */
.form-card {
  background: #f5f5f5;
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
}

.intro-card {
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}

/* ---- Intro layout ---- */
.intro-layout {
  display: flex;
  align-items: flex-start;
  min-height: 340px;
}

.intro-accordions {
  flex: 0 0 47%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-image {
  flex: 0 0 53%;
  height: 520px;
  align-self: flex-start;
  overflow: hidden;
}
.intro-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  min-height: 300px;
  background: #d0d0d0;
}

/* ---- Accordéons ---- */
.accordion {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Gotham', Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #e0194e;
  text-align: left;
  gap: 8px;
  transition: background 0.15s;
}

.accordion.open .accordion-header {
  background: #e9edf5;
}

.accordion-header:hover {
  background: #e9edf5;
}

.accordion-header:focus-visible {
  background: #e9edf5;
}

.accordion-chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-right: 1.6px solid #7d858f;
  border-bottom: 1.6px solid #7d858f;
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  margin-right: 4px;
}

.accordion.open .accordion-chevron {
  transform: rotate(-135deg);
}

.accordion-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  border-top: 0 solid #eee;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease, border-top-width 0.28s ease;
}

.accordion.open .accordion-body {
  max-height: 1400px;
  opacity: 1;
  padding: 12px 14px 16px;
  border-top-width: 1px;
}

.accordion-body[hidden] {
  display: block;
}

.accordion-body ul,
.accordion-body ol {
  padding-left: 18px;
  margin-top: 6px;
}
.accordion-body li { margin-bottom: 4px; }
.accordion-body ul ul { margin-top: 4px; }

.formula-op-small { font-weight: 700; font-size: 12px; margin: 6px 0 2px; }
.formula-indent { margin-left: 16px; margin-bottom: 4px; }

/* ---- Intro actions & footer info ---- */
.intro-actions { margin-bottom: 16px; }

.info-footer-text { font-size: 13px; margin-top: 8px; line-height: 1.6; }

/* ---- Spacing utilities ---- */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ---- Form ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 13px;
  font-weight: 400;
  color: #333;
}

.input-euro {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 3px;
  overflow: hidden;
}

.input-euro input {
  flex: 1;
  border: none;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  background: transparent;
  color: #333;
}

.input-euro input:disabled {
  background: #e8e8e8;
  color: #888;
  cursor: not-allowed;
}

.input-euro input::placeholder { color: #bbb; }

.input-euro span {
  padding: 8px 10px;
  font-size: 14px;
  color: #555;
  border-left: 1px solid #bbb;
  background: #f9f9f9;
}

.input-euro input:focus { background: #fff; }

/* info button */
.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #777;
  font-size: 13px;
  padding: 0 2px;
  vertical-align: middle;
}
.info-btn:hover { color: #1a3a6b; }

.required { color: #e0194e; font-weight: bold; }

/* Reste à vivre row */
.reste-group {
  max-width: 49%;
  margin-bottom: 20px;
}

.form-separator { border: none; border-top: 1px solid #ddd; margin: 16px 0; }

/* ---- Radios ---- */
.radios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.radio-label {
  font-size: 13px;
  margin-bottom: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  accent-color: #e0194e;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ---- Buttons ---- */
.form-actions { display: flex; gap: 12px; align-items: center; }

/* Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  font-family: 'Gotham', Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.btn:focus-visible {
  outline: 3px solid #6b9cd8;
  outline-offset: 2px;
}

/* ---------- Primary ---------- */
.btn-primary {
  background: #1a3a6b;
  color: #fff;
  border-color: #1a3a6b;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: #213f72;
  border-color: #213f72;
  box-shadow: 0 2px 6px rgba(26,58,107,0.35);
}
.btn-primary:active {
  background: #152d58;
  border-color: #152d58;
  box-shadow: none;
}
.btn-primary:disabled,
.btn-primary[disabled] {
  background: #8a9ab5;
  border-color: #8a9ab5;
  color: #d0d8e8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Secondary ---------- */
.btn-secondary {
  background: #eef1f7;
  color: #1a3a6b;
  border-color: #eef1f7;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #dde4f2;
  border-color: #dde4f2;
  box-shadow: 0 2px 6px rgba(26,58,107,0.15);
}
.btn-secondary:active {
  background: #ccd5ea;
  border-color: #ccd5ea;
  box-shadow: none;
}
.btn-secondary:disabled,
.btn-secondary[disabled] {
  background: #e8eaed;
  border-color: #e8eaed;
  color: #a0a8b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Base (texte neutre, fond gris clair) ---------- */
.btn-base {
  background: transparent;
  color: #1a3a6b;
  border-color: transparent;
}
.btn-base:hover,
.btn-base:focus-visible {
  background: #eef1f7;
  border-color: #eef1f7;
}
.btn-base:active {
  background: #dde4f2;
  border-color: #dde4f2;
}
.btn-base:disabled,
.btn-base[disabled] {
  color: #a0a8b8;
  cursor: not-allowed;
}

/* ---------- Outline Primary (bordure + texte rose/crimson) ---------- */
.btn-outline-primary {
  background: #fff;
  color: #e0194e;
  border-color: #e0194e;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  background: #e0194e;
  color: #fff;
  box-shadow: 0 2px 6px rgba(224,25,78,0.3);
}
.btn-outline-primary:active {
  background: #c5174a;
  border-color: #c5174a;
  color: #fff;
  box-shadow: none;
}
.btn-outline-primary:disabled,
.btn-outline-primary[disabled] {
  color: #e893ae;
  border-color: #e893ae;
  background: #fff;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Outline Secondary (bordure + texte navy) ---------- */
.btn-outline {
  background: #fff;
  color: #1a3a6b;
  border-color: #1a3a6b;
  font-weight: 500;
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: #1a3a6b;
  color: #fff;
  box-shadow: 0 2px 6px rgba(26,58,107,0.3);
}
.btn-outline:active {
  background: #152d58;
  border-color: #152d58;
  color: #fff;
  box-shadow: none;
}
.btn-outline:disabled,
.btn-outline[disabled] {
  color: #8a9ab5;
  border-color: #8a9ab5;
  background: #fff;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Link ---------- */
.btn-link {
  background: transparent;
  color: #1a3a6b;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  font-weight: 400;
  text-decoration: underline;
}
.btn-link:hover,
.btn-link:focus-visible {
  color: #e0194e;
  background: transparent;
}
.btn-link:active {
  color: #c5174a;
}
.btn-link:disabled,
.btn-link[disabled] {
  color: #a0a8b8;
  cursor: not-allowed;
  text-decoration: none;
}

/* ---- Form notes ---- */
.form-notes { font-size: 12px; color: #444; line-height: 1.6; }
.form-notes p { margin-bottom: 4px; }

/* ---- Result table ---- */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table tr { border-bottom: 1px solid #e5e5e5; }
.result-table tr:last-child { border-bottom: none; }

.result-label {
  padding: 10px 12px 10px 0;
  color: #333;
  width: 35%;
}

.result-value {
  padding: 10px 20px 10px 8px;
  color: #333;
  font-weight: 500;
  width: 15%;
}

.result-radio {
  padding: 10px 8px;
  width: 10%;
}

.result-radio .radio-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #e0194e;
}

.result-radio .radio-dot::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e0194e;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e0194e;
}

/* ---- Result blocks ---- */
.result-block { margin-top: 20px; }
.result-block.hidden { display: none; }

.result-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 12px;
}
.result-title.ineligible { color: #e0194e; }
.result-title.eligible { color: #e0194e; }

.result-subtitle {
  font-weight: bold;
  color: #e0194e;
  font-size: 13px;
}

.result-block p { line-height: 1.6; font-size: 13px; }
.result-block ol { padding-left: 20px; margin-top: 8px; }
.result-block ol li { margin-bottom: 8px; line-height: 1.5; font-size: 13px; }
.result-block ul { padding-left: 20px; margin-top: 6px; }
.result-block ul li { margin-bottom: 4px; line-height: 1.5; font-size: 13px; }
.result-block ul ul { margin-top: 4px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid #e5e5e5;
  padding: 16px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy { font-size: 12px; color: #e0194e; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  font-size: 12px;
  color: #1a3a6b;
}

/* ---- Field validation ---- */
input.invalid { border-color: #e0194e !important; }
.field-error { font-size: 11px; color: #e0194e; margin-top: 2px; }
