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

:root {
  --green: #1D9E75;
  --red: #E24B4A;
  --orange: #EF9F27;
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --border: #E5E2DC;
  --border-light: #EEEBE6;
  --text: #1A1814;
  --text-2: #5C5A56;
  --text-3: #9A9891;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

.page {
  max-width: 560px;
  margin: 0 auto;
}

header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.intro {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 20px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}

.sec-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button { -webkit-appearance: none; }

.field input:focus { border-color: var(--green); }

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}

.stepper:focus-within { border-color: var(--green); }

.stepper input {
  border: none;
  background: transparent;
  text-align: center;
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  border-radius: 0;
}

.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.stepper-btn:hover {
  background: var(--border-light);
  color: var(--text);
}

.stepper-btn:active {
  background: var(--border);
}

.field-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 6px;
}

.nonf-wrap { margin-top: 1.25rem; }

.nonf-wrap .stepper { width: 160px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.metric {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
}

.metric.hl {
  background: var(--surface);
  border: 1px solid var(--border);
}

.metric-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  line-height: 1.4;
}

.metric-val {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  transition: color 0.3s;
}

@keyframes flash-update {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.metric-val.updated {
  animation: flash-update 0.35s ease-out;
}

.metric-val.danger { color: var(--red); }
.metric-val.sm { font-size: 15px; }
.metric-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }

.pie-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.pie-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-val { margin-left: auto; font-weight: 500; color: var(--text); font-size: 13px; }

.legend-sep {
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  color: var(--text-3);
  font-size: 12px;
}

.ca-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.plafond-card {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(226,75,74,0.06), 0 4px 12px rgba(226,75,74,0.04);
}

.plafond-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B91C1C;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.plafond-val {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--red);
  line-height: 1.1;
  margin-bottom: 2px;
}

.plafond-val-net {
  font-size: 15px;
  font-weight: 500;
  color: #B91C1C;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

.plafond-sub {
  font-size: 13px;
  color: #7F1D1D;
  line-height: 1.65;
  opacity: 0.8;
}

.verdict {
  border-left: 2.5px solid var(--red);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verdict p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
}

.cta-card {
  display: block;
  text-decoration: none;
  background: var(--text);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.cta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.cta-card p {
  font-size: 15px;
  color: #FFFFFF;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 6px;
}

.cta-card .cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
  margin-left: 4px;
}

.cta-card:hover .cta-arrow {
  transform: translateX(3px);
}

.cta-card p.sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  margin: 0;
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .ca-grid { grid-template-columns: 1fr; }
  .metric-val { font-size: 17px; }
}
