/* "Décrivez votre besoin" — styles of the form (dedicated page, homepage section, edit mode), following the approved mock-up:
   white rounded card, coral call to action and selected states, icon-led labels, two-column grid.
   Self-contained: the tokens below are the design-system values (css/roastmydorm-design-system.css, accent = --rmd-accent), repeated
   under .hn-scope because the homepage does not load the design system (its global resets would change the page). */
.hn-scope {
  --hn-accent: #ff6b4a; --hn-accent-dark: #e6512f; --hn-accent-bg: #fff1ec; --hn-accent-soft: #ffd9cf;
  --hn-green: #10b981; --hn-green-dark: #059669; --hn-green-bg: #ecfdf5; --hn-blue: #3b6ff5; --hn-blue-bg: #eaf0ff;
  --hn-text: #0f172a; --hn-muted: #64748b; --hn-border: #e5e7eb; --hn-surface: #ffffff; --hn-danger: #dc2626;
  --hn-radius: 12px; --hn-radius-lg: 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--hn-text);
}
.hn-scope *, .hn-scope *::before, .hn-scope *::after { box-sizing: border-box; }
.hn-scope :focus-visible { outline: 3px solid var(--hn-accent-soft); outline-offset: 2px; }

/* ── dedicated page: hero on the left, form card on the right ── */
.hn-page { background: linear-gradient(135deg, #fff7f3 0%, #fffdfb 55%, #fff 100%); min-height: 70vh; }
.hn-page-inner { max-width: 1240px; margin: 0 auto; padding: 24px 16px 56px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .hn-page-inner { grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: 40px; padding: 28px 32px 72px; align-items: start; } }
.hn-back { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--hn-muted); text-decoration: none; margin-bottom: 18px; }
.hn-back:hover { color: var(--hn-accent-dark); }
.hn-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 999px; background: var(--hn-accent-bg); color: var(--hn-text); font-size: .85rem; font-weight: 500; margin: 0 0 18px; }
.hn-pill i { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--hn-accent); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.hn-hero h1 { font-family: 'Poppins', 'Inter', sans-serif; font-size: clamp(1.8rem, 3.3vw, 2.75rem); line-height: 1.12; font-weight: 700; margin: 0 0 16px; color: #0b1b3b; letter-spacing: -0.01em; }
.hn-hero h1 em { font-style: normal; color: var(--hn-accent); }
.hn-hero-lead { color: #475569; font-size: 1.05rem; line-height: 1.6; margin: 0 0 8px; max-width: 30em; }
.hn-illus { display: none; margin: 8px 0 0; }
@media (min-width: 1024px) { .hn-illus { display: block; } }
.hn-illus svg { width: 100%; max-width: 440px; height: auto; display: block; }
.hn-benefits { display: grid; gap: 18px; margin-top: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .hn-benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hn-benefit { display: flex; gap: 12px; align-items: flex-start; }
.hn-benefit-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.hn-benefit-icon.is-accent { background: var(--hn-accent-bg); color: var(--hn-accent); }
.hn-benefit-icon.is-blue { background: var(--hn-blue-bg); color: var(--hn-blue); }
.hn-benefit-icon.is-green { background: var(--hn-green-bg); color: var(--hn-green-dark); }
.hn-benefit h3 { margin: 0 0 4px; font-size: .92rem; line-height: 1.3; }
.hn-benefit p { margin: 0; font-size: .8rem; color: var(--hn-muted); line-height: 1.5; }

/* ── the card ── */
.hn-card { background: var(--hn-surface); border: 1px solid #f1ebe6; border-radius: var(--hn-radius-lg); box-shadow: 0 10px 40px rgba(15, 23, 42, .07); padding: 22px 18px; }
@media (min-width: 640px) { .hn-card { padding: 30px 32px 24px; } }
.hn-card-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.hn-card-badge { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--hn-accent-bg); color: var(--hn-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.hn-title { text-wrap: balance; font-family: "Poppins", "Inter", sans-serif; font-size: clamp(1.25rem, 2.3vw, 1.6rem); line-height: 1.15; margin: 0 0 6px; color: #0b1b3b; font-weight: 700; }
.hn-lead { color: var(--hn-muted); margin: 0; font-size: .95rem; line-height: 1.55; }

/* ── form ── */
.hn-grid { display: grid; gap: 16px 20px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 720px) { .hn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hn-field { min-width: 0; position: relative; }
.hn-fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.hn-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .86rem; color: var(--hn-text); margin: 0 0 8px; padding: 0; }
.hn-label > i { flex: none; width: 18px; text-align: center; color: #334155; font-size: .95rem; }
.hn-req { color: var(--hn-accent); }
.hn-opt, .hn-sub { font-weight: 400; color: var(--hn-muted); }
.hn-input { display: block; width: 100%; min-height: 48px; padding: 0 14px; font: 500 .95rem 'Inter', sans-serif; color: var(--hn-text); background: #fff; border: 1.5px solid var(--hn-border); border-radius: var(--hn-radius); transition: border-color .15s, box-shadow .15s; }
select.hn-input { appearance: none; -webkit-appearance: none; padding-right: 38px; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center; }
.hn-input:focus { border-color: var(--hn-accent); box-shadow: 0 0 0 3px var(--hn-accent-bg); outline: none; }
.hn-input[aria-invalid="true"] { border-color: var(--hn-danger); }
.hn-err { color: var(--hn-danger); font-size: .8rem; margin: 6px 0 0; }
.hn-hint { color: var(--hn-muted); font-size: .78rem; margin: 8px 0 0; }

/* neighbourhoods multi-select */
.hn-multi { position: relative; }
.hn-multi-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; color: var(--hn-muted); font-weight: 400; font-size: .88rem; }
.hn-multi-btn.has-value { color: var(--hn-text); font-weight: 600; }
.hn-multi-btn i { color: var(--hn-muted); font-size: .8rem; flex: none; }
.hn-multi-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-multi-panel { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1.5px solid var(--hn-border); border-radius: var(--hn-radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 10px; max-height: 320px; overflow: auto; }
.hn-multi-panel[hidden] { display: none; }
.hn-multi-list { display: grid; gap: 2px; margin-bottom: 8px; }
.hn-multi-item { min-height: 40px; padding: 4px 6px; border-radius: 8px; }
.hn-multi-item:hover { background: var(--hn-accent-bg); }
.hn-add { display: flex; gap: 8px; }
.hn-add .hn-input { min-height: 44px; font-size: .9rem; }

/* housing type tiles */
.hn-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .hn-types { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hn-type { position: relative; display: block; cursor: pointer; }
.hn-type input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hn-type span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 74px; padding: 12px 8px; text-align: center; font-size: .82rem; font-weight: 500; color: #64748b; background: #fff; border: 1.5px solid var(--hn-border); border-radius: var(--hn-radius); transition: border-color .15s, background .15s, color .15s; }
.hn-type span i { font-size: 1.25rem; color: #64748b; }
.hn-type:hover span { border-color: var(--hn-accent-soft); }
.hn-type input:checked + span { border-color: var(--hn-accent); background: var(--hn-accent-bg); color: var(--hn-text); font-weight: 700; }
.hn-type input:checked + span i { color: var(--hn-accent); }
.hn-type input:focus-visible + span { outline: 3px solid var(--hn-accent-soft); outline-offset: 2px; }
.hn-fieldset:has(input[aria-invalid="true"]) .hn-type span { border-color: var(--hn-danger); }

/* "Autres critères" */
.hn-checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 24px; padding-left: 4px; }
@media (min-width: 560px) { .hn-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; } }
.hn-check { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: .9rem; cursor: pointer; }
.hn-check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.8px solid #cbd5e1; border-radius: 6px; background: #fff; display: inline-grid; place-content: center; cursor: pointer; transition: background .12s, border-color .12s; }
.hn-check input::after { content: ''; width: 11px; height: 6px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.hn-check input:checked { background: var(--hn-accent); border-color: var(--hn-accent); }
.hn-check input:checked::after { opacity: 1; }
.hn-check input:focus-visible { outline: 3px solid var(--hn-accent-soft); outline-offset: 2px; }
.hn-sub-field { margin: 10px 0 0; }

.hn-textarea-wrap { position: relative; }
.hn-textarea { min-height: 96px; padding: 12px 14px 26px; resize: vertical; line-height: 1.5; font-weight: 400; }
.hn-count { position: absolute; right: 12px; bottom: 8px; font-size: .74rem; color: var(--hn-muted); pointer-events: none; }

.hn-status { min-height: 1.3em; font-size: .9rem; margin: 6px 0 8px; }
.hn-status.is-error { color: var(--hn-danger); font-weight: 600; }
.hn-status.is-info { color: var(--hn-muted); }
.hn-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--hn-radius); font: 700 .95rem 'Inter', sans-serif; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s; }
.hn-btn:active { transform: translateY(1px); }
.hn-btn-cta { flex: 1 1 260px; min-height: 54px; background: var(--hn-accent); color: #fff; font-size: 1rem; box-shadow: 0 8px 22px rgba(255, 107, 74, .32); }
.hn-btn-cta:hover { background: var(--hn-accent-dark); }
.hn-btn-cta[disabled] { opacity: .65; cursor: progress; }
.hn-btn-light { background: #fff; color: var(--hn-text); border: 1.5px solid var(--hn-border); }
.hn-btn-light:hover { background: #f8fafc; }
.hn-privacy { display: flex; gap: 8px; align-items: flex-start; justify-content: center; font-size: .76rem; color: var(--hn-muted); margin: 16px 0 0; text-align: center; }

.hn-success { text-align: center; padding: 24px 8px; outline: none; }
.hn-success-icon { font-size: 2.6rem; color: var(--hn-accent); }
.hn-success h2 { margin: 12px 0 8px; font-family: 'Poppins', 'Inter', sans-serif; }
.hn-success p { color: #475569; max-width: 34em; margin: 0 auto 10px; }
.hn-success .hn-actions { justify-content: center; margin-top: 16px; }

/* ── homepage section (part of the page flow, never an overlay) ── */
.hn-onboard { padding: 40px 0; background: linear-gradient(135deg, #fff7f3 0%, #fffdfb 100%); }
.hn-onboard[hidden] { display: none; }
.hn-onboard-inner { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.hn-seeit { max-width: 960px; margin: 0 auto; padding: 12px 16px; font-size: .9rem; }
.hn-seeit a { font-weight: 600; color: var(--hn-accent-dark); }

/* ── "Mes demandes" section ── */
.hn-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.hn-item { background: #fff; border: 1px solid var(--rmd-border, #ece5db); border-radius: 20px; padding: 16px; }
.hn-item-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; justify-content: space-between; }
.hn-item-title { font-weight: 700; margin: 0; }
.hn-item-meta { color: #64748b; font-size: .85rem; margin: 4px 0 0; }
.hn-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #f1f5f9; color: #475569; }
.hn-badge.is-new, .hn-badge.is-reviewing { background: #eff6ff; color: #1d4ed8; }
.hn-badge.is-match_found, .hn-badge.is-fulfilled { background: #ecfdf5; color: #047857; }
.hn-badge.is-contacted { background: #fff7ed; color: #9a3412; }
.hn-details { margin-top: 12px; border-top: 1px solid #ece5db; padding-top: 12px; }
.hn-details dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.hn-details dt { color: #64748b; }
.hn-details dd { margin: 0; overflow-wrap: anywhere; }
.hn-item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.hn-item-actions .btn { min-height: 44px; }
@media (max-width: 420px) { .hn-details dl { grid-template-columns: 1fr; } .hn-details dt { margin-top: 6px; } }
@media (prefers-reduced-motion: reduce) { .hn-type span, .hn-input, .hn-btn, .hn-check input { transition: none; } }

/* ── "Mes demandes": tabs + section B (listing enquiries) ── */
.ma-tabs { display: flex; gap: 6px; margin-top: 20px; border-bottom: 1px solid var(--rmd-border, #ece5db); overflow-x: auto; }
.ma-tabs [role="tab"] { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; min-height: 44px; font: 600 .95rem 'Inter', sans-serif; color: #64748b; cursor: pointer; white-space: nowrap; }
.ma-tabs [role="tab"][aria-selected="true"] { color: #1f2937; border-bottom-color: #ff6b4a; }
.ma-tabs [role="tab"]:focus-visible { outline: 3px solid #ff6b4a; outline-offset: -3px; border-radius: 8px; }
.ma-count { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .75rem; text-align: center; }
.ma-count:empty { display: none; }
[role="tabpanel"] { padding-top: 20px; }
[role="tabpanel"][hidden] { display: none; }
.ma-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.ma-card { background: #fff; border: 1px solid var(--rmd-border, #ece5db); border-radius: 20px; padding: 16px; }
.ma-top { display: flex; gap: 12px; }
.ma-photo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: #fff3ee; }
.ma-body { flex: 1; min-width: 0; }
.ma-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.ma-meta { color: #64748b; font-size: .85rem; margin: 2px 0 0; }
.ma-badge { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #f1f5f9; color: #475569; }
.ma-badge.is-warn { background: #fff7ed; color: #9a3412; }
.ma-badge.is-info { background: #eff6ff; color: #1d4ed8; }
.ma-badge.is-ok { background: #ecfdf5; color: #047857; }
.ma-action { margin: 12px 0 0; font-weight: 600; color: #9a3412; }
.ma-note { margin: 12px 0 0; font-size: .85rem; color: #64748b; }
.ma-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: #c2410c; text-decoration: underline; cursor: pointer; }
.ma-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ma-actions .btn { min-height: 44px; }
.ma-timeline { list-style: none; margin: 12px 0 0; padding: 12px 0 0 0; border-top: 1px solid #ece5db; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.ma-timeline[hidden] { display: none; }
.ma-timeline li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.ma-t-date { color: #64748b; }
.ma-outcome { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ece5db; }
.ma-outcome p { margin: 0 0 10px; font-weight: 600; font-size: .9rem; }
.ma-outcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ma-outcome-actions button { min-height: 44px; border-radius: 12px; border: 1.5px solid #e5e7eb; background: #fff; font-weight: 600; font-size: .85rem; cursor: pointer; }
.ma-outcome-actions button[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 480px) { .ma-outcome-actions { grid-template-columns: 1fr; } .ma-timeline li { flex-direction: column; } }

/* ── exit-intent offer on the city pages (js/housing-need-exit-intent.js) ── */
.hn-exit-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.hn-exit-box { position: relative; background: #fff; border-radius: 24px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px 24px 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); outline: none; }
.hn-exit-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.hn-exit-close:focus-visible, .hn-exit-no:focus-visible { outline: 3px solid #ff6b4a; outline-offset: 2px; }
.hn-exit-head { padding-right: 40px; margin-bottom: 12px; }
.hn-exit-no { display: block; margin: 14px auto 0; min-height: 44px; padding: 8px 14px; background: none; border: 0; color: #475569; font: 600 .95rem 'Inter', sans-serif; text-decoration: underline; cursor: pointer; }
/* the scrolling part of the offer: on desktop it is not a box at all (the box itself scrolls, exactly as before) */
.hn-exit-scroll { display: contents; }
/* phones: a bottom sheet that always fits what is VISIBLE (dynamic viewport units: 100vh/92vh are measured with the browser bars hidden, so on iOS Safari the sheet slid under them and the
   lower fields and the submit button could not be reached). The sheet scrolls inside itself, the close button stays put, the page behind does not move (see lockScroll in the script). */
@media (max-width: 600px) {
  .hn-exit-overlay { align-items: flex-end; padding: 0; height: 100vh; overscroll-behavior: contain; }
  .hn-exit-box { display: flex; flex-direction: column; overflow: hidden; max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding: 0; }
  .hn-exit-box::before { content: ""; flex: none; width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; margin: 8px auto 2px; }
  .hn-exit-scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .hn-exit-close { top: 8px; right: 8px; z-index: 2; }
  .hn-exit-head { padding-right: 52px; margin-bottom: 8px; }
  .hn-exit-box .hn-title { font-size: 1.2rem; }
  .hn-exit-box .hn-lead { font-size: .9rem; line-height: 1.45; }
  .hn-exit-box .hn-grid { gap: 12px; margin-bottom: 12px; }
  .hn-exit-box .hn-fieldset { margin-bottom: 12px; }
  .hn-exit-no { margin-top: 6px; }
}
@supports (height: 100dvh) {
  @media (max-width: 600px) {
    .hn-exit-overlay { height: 100dvh; }
    .hn-exit-box { max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 8px)); }
  }
}

/* How the student wants to receive recommendations (lot NP): two choices, the WhatsApp number and its explicit consent */
.hn-types.hn-notif-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hn-notif .hn-type span { min-height: 84px; }
.hn-notif-hint { display: block; font-weight: 400; font-size: .72rem; color: var(--hn-muted); overflow-wrap: anywhere; }
#hn-wa-wrap[hidden] { display: none; }
.hn-consent { align-items: flex-start; margin-top: 12px; }
.hn-consent input { margin-top: 3px; flex: 0 0 auto; }
.hn-consent:has(input[aria-invalid="true"]) span { color: var(--hn-danger); }
/* the existing rule that reddens the choice cards of a fieldset holding an invalid input must not apply here: the invalid input is the number, not the channel */
.hn-notif.hn-fieldset:has(input[aria-invalid="true"]) .hn-type span { border-color: var(--hn-border); }
.hn-notif.hn-fieldset:has(input[aria-invalid="true"]) .hn-type input:checked + span { border-color: var(--hn-accent); }
