:root {
  color-scheme: light;
  --ink: #14211c;
  --muted: #69766f;
  --paper: #f3f5f0;
  --card: #fffefa;
  --line: #dde2db;
  --green: #bcec68;
  --green-dark: #2c6540;
  --navy: #12201a;
  --blue: #dcecf6;
  --mint: #e2f1da;
  --amber: #f2e2b6;
  --red: #9c403a;
  --shadow: 0 22px 70px rgba(18, 32, 26, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif; }
body.menu-open { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(84, 128, 69, .3); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.04em; line-height: 1.08; }
.eyebrow { margin-bottom: 10px; color: #7d8982; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.button { border: 0; border-radius: 11px; padding: 12px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); background: white; font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { background: var(--green); box-shadow: 0 9px 24px rgba(94, 137, 56, .2); }
.button.secondary { border: 1px solid var(--line); background: #fffefa; }
.button.dark { color: white; background: var(--navy); }
.button.full { width: 100%; }
.message { border: 1px solid #cee0c4; border-radius: 11px; padding: 12px 14px; color: #37603d; background: #edf7e9; font-size: 12px; }
.message.error { border-color: #efcbc6; color: var(--red); background: #fcf0ee; }

/* Accès */
.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.04fr) minmax(460px, .96fr); background: var(--navy); }
.auth-story { position: relative; min-height: 100vh; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; overflow: hidden; color: white; background:
  radial-gradient(circle at 78% 72%, rgba(188, 236, 104, .16), transparent 25%),
  radial-gradient(circle at 30% 15%, rgba(91, 143, 111, .12), transparent 29%),
  var(--navy); }
.auth-story::after { content: ''; position: absolute; right: -14vw; bottom: -25vw; width: 48vw; height: 48vw; border: 1px solid rgba(188, 236, 104, .13); border-radius: 50%; box-shadow: 0 0 0 7vw rgba(188, 236, 104, .018), 0 0 0 14vw rgba(188, 236, 104, .018); }
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: white; font-size: 17px; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.brand.dark { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; padding: 9px; display: flex; align-items: end; justify-content: center; gap: 3px; border-radius: 10px; background: var(--green); transform: rotate(-2deg); }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: var(--navy); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 11px; }
.auth-pitch { position: relative; z-index: 1; max-width: 610px; margin: auto 0; padding: 90px 0; }
.auth-pitch .eyebrow { color: var(--green); }
.auth-pitch h1 { margin-bottom: 24px; font-size: clamp(48px, 6vw, 86px); font-weight: 600; }
.auth-pitch > p:last-child { max-width: 490px; margin-bottom: 0; color: #a5b2ac; font-size: 17px; line-height: 1.7; }
.trust-list { position: relative; z-index: 1; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 25px; color: #87968f; list-style: none; font-size: 11px; }
.trust-list span { margin-right: 6px; color: var(--green); }
.auth-panel { min-height: 100vh; padding: 50px clamp(30px, 6vw, 96px); display: grid; place-content: center; background: #f6f6f1; }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { margin-bottom: 12px; font-size: clamp(34px, 4vw, 48px); font-weight: 600; }
.auth-intro { margin-bottom: 26px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-card .message { margin-bottom: 18px; }
form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #65716b; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; font-size: 12px; }
input:focus { border-color: #89a66e; box-shadow: 0 0 0 3px rgba(116, 151, 87, .12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 78px; }
.password-toggle { position: absolute; right: 9px; top: 50%; border: 0; padding: 4px; color: #66736c; background: transparent; transform: translateY(-50%); font-size: 10px; font-weight: 800; cursor: pointer; }
.access-note { margin: 16px 0 0; display: flex; gap: 8px; align-items: flex-start; color: #8a938e; font-size: 10px; line-height: 1.45; }
.access-note span { flex: 0 0 auto; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid #aeb6b1; border-radius: 50%; font-size: 9px; }
.verification-area { margin-top: 22px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 12px; border: 1px solid #dce5d7; border-radius: 13px; background: #fbfcf8; }
.verification-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--mint); }
.verification-area h3 { margin: 2px 0 5px; font-size: 15px; }
.verification-area p { margin: 0; color: var(--muted); font-size: 10px; }
.verification-area form { grid-column: 1 / -1; }
.site-footer { color: #8a948f; font-size: 9px; }
.site-footer > div { display: flex; align-items: center; gap: 9px; }
.site-footer strong { color: #626e68; font-size: 10px; }
.site-footer > div > span { padding-left: 9px; border-left: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 7px 15px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }
.auth-footer { width: min(430px, 100%); margin: 24px 0 0; display: grid; justify-items: center; gap: 10px; text-align: center; }

/* Espace connecté */
.app-view { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 20; height: 76px; padding: 0 clamp(20px, 4vw, 58px); display: grid; grid-template-columns: 42px 1fr auto; gap: 19px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(250, 250, 246, .92); backdrop-filter: blur(14px); }
.icon-button { width: 40px; height: 40px; padding: 10px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.icon-button span { width: 17px; height: 1.5px; display: block; border-radius: 2px; background: var(--ink); }
.header-account { display: flex; align-items: center; gap: 12px; }
.header-account > span:first-child { display: grid; text-align: right; }
.header-account small { color: #8b948f; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.header-account strong { max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #1a261f; background: var(--green); font-size: 12px; font-weight: 800; }
.menu-backdrop { position: fixed; z-index: 29; inset: 0; background: rgba(12, 22, 18, .42); backdrop-filter: blur(2px); }
.app-menu { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(330px, 88vw); padding: 24px; display: flex; flex-direction: column; color: white; background: var(--navy); box-shadow: 15px 0 60px rgba(8, 15, 12, .24); transform: translateX(-105%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.app-menu.open { transform: translateX(0); visibility: visible; }
.menu-head { padding: 3px 5px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #2b3732; color: #8d9a94; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.close-button { border: 0; color: #a7b2ad; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; }
.app-menu nav { margin-top: 24px; display: grid; gap: 8px; }
.menu-link { width: 100%; padding: 13px; display: flex; gap: 13px; align-items: center; border: 0; border-radius: 11px; color: #9ba7a1; background: transparent; text-align: left; cursor: pointer; }
.menu-link:hover, .menu-link.active { color: white; background: rgba(255, 255, 255, .07); }
.menu-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #35433d; border-radius: 9px; color: var(--green); font-size: 15px; }
.menu-link > span:last-child { display: grid; }
.menu-link strong { font-size: 12px; }
.menu-link small { margin-top: 2px; color: #6f7d77; font-size: 9px; }
.logout-button { margin-top: auto; padding: 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #2c3a34; border-radius: 10px; color: #aab4af; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.app-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 40px; }
.app-message { position: fixed; z-index: 25; right: 24px; bottom: 24px; max-width: 380px; box-shadow: var(--shadow); }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.page-heading h1 { margin-bottom: 10px; font-size: clamp(36px, 5vw, 58px); font-weight: 600; }
.page-heading h1 span { color: #53775c; }
.page-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.summary-grid { margin-top: 35px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.summary-grid article { min-height: 100px; padding: 20px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 10px 35px rgba(19, 34, 27, .04); }
.summary-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; font-size: 17px; }
.summary-icon.green { background: var(--mint); }
.summary-icon.blue { background: var(--blue); }
.summary-icon.amber { color: #b67e25; background: var(--amber); font-size: 11px; }
.summary-grid article div { display: grid; }
.summary-grid small { color: #87918c; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.summary-grid strong { margin-top: 4px; font-size: 18px; letter-spacing: -.03em; }
.panel { margin-top: 18px; padding: 27px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 42px rgba(19, 34, 27, .045); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 25px; }
.panel-heading.compact { margin-bottom: 22px; }
.panel-heading h2 { margin-bottom: 7px; font-size: 24px; font-weight: 600; }
.panel-heading p:last-child { max-width: 510px; margin-bottom: 0; color: var(--muted); font-size: 11px; }
.step-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #637069; background: #f0f2ec; font-size: 9px; font-weight: 800; }
.consent-row { margin: 22px 0; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf7; }
.checkbox { display: flex; grid-auto-flow: column; grid-template-columns: auto 1fr; align-items: center; justify-content: start; gap: 8px; color: var(--ink); font-size: 11px; cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: #4f844d; }
.checkbox strong, .checkbox small { display: block; }
.checkbox small { margin-top: 2px; color: #8a938e; font-size: 9px; font-weight: 500; }
.provider-grid { margin-bottom: 13px; display: flex; flex-wrap: wrap; gap: 9px; }
.provider-grid > div { padding: 7px 9px; display: flex; align-items: center; gap: 7px; border-radius: 8px; background: #f2f3ee; font-size: 9px; }
.provider-grid strong { text-transform: uppercase; letter-spacing: .05em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #c49b49; }
.status-dot.ok { background: #5aa463; }
.pill { padding: 3px 7px; border-radius: 99px; color: #6f7a74; background: #e7eae5; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pill.ok { color: #376e42; background: #dceedd; }
.disconnect-button { border: 0; padding: 0 0 0 5px; color: #7a8580; background: transparent; font-size: 8px; text-decoration: underline; cursor: pointer; }
.provider-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.provider-card { min-width: 0; min-height: 170px; padding: 20px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr; gap: 12px 14px; align-items: start; border-radius: 13px; }
.withings-card { background: var(--mint); }
.garmin-card { background: var(--blue); }
.provider-logo { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--navy); font-size: 17px; font-weight: 800; }
.provider-logo.garmin { background: #176f9c; }
.provider-card h3 { margin: 2px 0 5px; font-size: 16px; }
.provider-card p { margin: 0; color: #5c6b63; font-size: 10px; }
.provider-card > .button { align-self: start; }
.provider-fields { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.provider-fields input { background: rgba(255, 255, 255, .7); }
.garmin-card > .button { grid-column: 3; grid-row: 1; }
.mfa-form { margin-top: 13px; grid-template-columns: 1fr auto; align-items: end; }
.dashboard-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; }
.dashboard-grid .panel { min-width: 0; }
fieldset { padding: 14px; display: flex; flex-wrap: wrap; gap: 10px 18px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 6px; color: #7d8982; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.imports { max-height: 340px; overflow: auto; display: grid; gap: 9px; }
.empty-state { margin: 0; padding: 36px 10px; color: #929b96; text-align: center; font-size: 11px; }
.job { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.job > div:first-child, .actions { display: flex; align-items: center; gap: 8px; }
.job > div:first-child { justify-content: space-between; }
.job p { margin: 8px 0; color: var(--muted); font-size: 9px; }
.mini-button { border: 0; border-radius: 7px; padding: 7px 9px; color: white; background: var(--navy); font-size: 8px; font-weight: 800; cursor: pointer; }
.mini-button.secondary { color: var(--ink); background: #e9ece7; }
.account-section { margin-top: 18px; padding: 24px 4px; display: flex; justify-content: space-between; align-items: end; gap: 25px; border-top: 1px solid var(--line); }
.account-section h2 { margin-bottom: 5px; font-size: 17px; }
.account-section p { margin: 0; color: var(--muted); font-size: 10px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contribution-form { margin-left: auto; grid-template-columns: 100px auto; align-items: end; }
.contribution-form input { padding-block: 10px; }
.text-button { border: 0; padding: 7px; color: #52635a; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.text-button.danger { color: var(--red); }
.support-heading { max-width: 780px; margin: 25px auto 0; text-align: center; }
.support-heading > div > p:last-child { max-width: 570px; margin-inline: auto; }
.support-empty { max-width: 650px; margin: 45px auto; padding: 64px 35px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-align: center; box-shadow: var(--shadow); }
.support-empty > span { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; color: #487052; background: var(--mint); font-size: 22px; font-weight: 700; }
.support-empty h2 { margin-bottom: 10px; font-size: 25px; }
.support-empty p { max-width: 450px; margin: 0 auto 24px; color: var(--muted); font-size: 12px; }
.app-footer { margin-top: 35px; padding: 20px 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); }

@media (max-width: 950px) {
  .auth-view { grid-template-columns: .82fr 1fr; }
  .auth-story { padding: 42px; }
  .auth-pitch h1 { font-size: clamp(45px, 7vw, 66px); }
  .trust-list { display: grid; gap: 8px; }
  .provider-actions, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .auth-view { display: block; background: #f6f6f1; }
  .auth-story { min-height: 300px; padding: 25px; }
  .auth-pitch { padding: 55px 0 25px; }
  .auth-pitch h1 { margin-bottom: 14px; font-size: 43px; }
  .auth-pitch > p:last-child { font-size: 13px; }
  .trust-list { display: none; }
  .auth-panel { min-height: auto; padding: 35px 22px 45px; }
  .app-header { height: 66px; padding-inline: 16px; grid-template-columns: 40px 1fr auto; }
  .app-header .brand > span:last-child { display: none; }
  .header-account > span:first-child { display: none; }
  .app-main { width: min(100% - 28px, 1180px); padding-top: 34px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .summary-grid article { min-height: 80px; }
  .panel { padding: 20px; }
  .consent-row { align-items: stretch; flex-direction: column; }
  .provider-card { grid-template-columns: auto 1fr; }
  .provider-card > .button, .garmin-card > .button { grid-column: 1 / -1; grid-row: auto; }
  .provider-fields { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .mfa-form { grid-template-columns: 1fr; }
  .account-section { align-items: stretch; flex-direction: column; }
  .contribution-form { margin-left: 0; grid-template-columns: 1fr auto; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .app-message { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

@media (max-width: 420px) {
  .auth-story { min-height: 270px; }
  .auth-pitch { padding-top: 42px; }
  .auth-pitch h1 { font-size: 38px; }
  .provider-grid { display: grid; }
  .provider-grid > div { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
