/* =========================================================
   ALADOM — Landing Page Maintien à domicile
   Charte : Aladom (palette bleue) + neutres
   ========================================================= */

/* ---------- TOKENS ---------- */
:root {
    /* Aladom palette */
    --aladom-blue: #1A6DFF;
    --aladom-blue-dark: #0A2540;
    --aladom-blue-soft: #E8F1FF;

    /* Darwin gradient palette */
    --cyan: #3DD9F0;
    --lime: #E8FF4D;
    --green-mid: #9BE85F;

    /* Neutrals */
    --white: #ffffff;
    --grey-50: #F8F9FB;
    --grey-100: #F1F3F7;
    --grey-200: #E4E8EE;
    --grey-300: #C9D0DA;
    --grey-500: #6B7280;
    --grey-700: #2A3340;
    --black: #0A0F1C;

    /* UI */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-card: 0 20px 60px -20px rgba(10, 37, 64, 0.25);
    --shadow-soft: 0 6px 20px -6px rgba(10, 37, 64, 0.15);

    --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --container: 1240px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--aladom-blue-dark);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

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

/* ---------- HEADER ---------- */
.site-header {
    position: relative;
    background: var(--white);
    padding: 18px 0;
    z-index: 5;
    border-bottom: 1px solid var(--grey-100);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.logo-link { display: inline-flex; }
.logo { height: 56px; width: auto; }

.header-tagline {
    color: var(--aladom-blue);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
}

/* ---------- HERO ---------- */
.hero {
    position: relative;
    min-height: 720px;
    padding: 60px 0 80px;
    overflow: hidden;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 50%, rgba(232, 241, 255, 0.85) 100%),
        url('https://images.unsplash.com/photo-1576765608535-5f04d1e3f289?auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

/* ---------- HERO TEXT ---------- */
.hero-text {
    color: var(--aladom-blue-dark);
}

.hero-title {
    font-size: clamp(28px, 3.4vw, 44px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    max-width: 520px;
    text-shadow: 0 2px 20px rgba(255,255,255,0.6);
}

.hero-title span {
    color: var(--aladom-blue);
    position: relative;
}

/* Wrapper banner + bulle : permet de positionner la bulle hors du cadre bleu sur mobile */
.hero-promo {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 520px;
}

.hero-banner {
    display: inline-flex;
    align-items: center;
    background: var(--aladom-blue);
    color: var(--white);
    padding: 14px 32px 14px 28px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-card);
}

.hero-banner-text {
    font-weight: 600;
    font-size: 16px;
    padding-right: 80px;
}

.hero-bubble {
    position: absolute;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--aladom-blue-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 30px -8px rgba(10, 37, 64, 0.5);
    border: 4px solid var(--white);
    animation: bubble-pulse 3s ease-in-out infinite;
}

@keyframes bubble-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50%      { transform: translateY(-50%) scale(1.04); }
}

.bubble-percent {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.bubble-text {
    font-size: 11px;
    line-height: 1.2;
    margin-top: 2px;
    font-weight: 600;
}

/* ---------- FUNNEL CARD ---------- */
.funnel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 36px 32px;
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.funnel-intro {
    text-align: center;
    color: var(--grey-700);
    font-size: 17px;
    margin-bottom: 28px;
    line-height: 1.4;
}

.funnel-intro strong { color: var(--aladom-blue-dark); font-weight: 700; }

/* Progress */
.progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--grey-100);
    border-radius: var(--radius-pill);
    padding: 6px;
    margin-bottom: 32px;
    gap: 4px;
}

.progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    color: var(--grey-500);
    transition: var(--transition);
    font-size: 12px;
    font-weight: 500;
    min-width: 0;
    position: relative;
}

.progress-step:hover { color: var(--aladom-blue-dark); }

.progress-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    color: var(--grey-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    transition: var(--transition);
    border: 2px solid var(--grey-200);
}

.progress-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-arrow {
    margin-left: auto;
    color: var(--aladom-blue);
    font-size: 16px;
    opacity: 0;
    transform: translateX(-4px);
    transition: var(--transition);
}

.progress-step.active .progress-arrow { opacity: 1; transform: translateX(0); }

.progress-step.active {
    background: var(--aladom-blue-dark);
    color: var(--white);
}

.progress-step.active .progress-num {
    background: var(--aladom-blue);
    color: var(--white);
    border-color: var(--aladom-blue);
}

.progress-step.completed .progress-num {
    background: var(--aladom-blue);
    color: var(--white);
    border-color: var(--aladom-blue);
}

/* ---------- STEPS ---------- */
.funnel-form { position: relative; }

.step {
    display: none;
    animation: stepIn 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

.step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.btn-back {
    color: var(--grey-500);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 18px;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-back:hover { color: var(--aladom-blue); }

.step-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--aladom-blue-dark);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.step-help {
    color: var(--grey-500);
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* ---------- CHOICE CARDS (radio) ---------- */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 22px 0 28px;
}

.choice-grid-3 { grid-template-columns: repeat(3, 1fr); }

.choice-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 22px 16px;
    background: var(--white);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--aladom-blue-dark);
    min-height: 76px;
}

.choice-card input { position: absolute; opacity: 0; pointer-events: none; }

.choice-card:hover {
    border-color: var(--aladom-blue);
    background: var(--aladom-blue-soft);
    transform: translateY(-2px);
}

.choice-card:has(input:checked) {
    border-color: var(--aladom-blue);
    background: var(--aladom-blue);
    color: var(--white);
    box-shadow: var(--shadow-soft);
}

.choice-label { font-size: 15px; line-height: 1.3; }

/* ---------- AGE INPUT ---------- */
.age-input {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--grey-100);
    padding: 8px;
    border-radius: var(--radius-pill);
    margin: 22px 0 28px;
    max-width: 320px;
}

.age-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--aladom-blue);
    color: var(--white);
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.age-btn:hover { background: var(--aladom-blue-dark); transform: scale(1.05); }
.age-btn:active { transform: scale(0.95); }

.age-input input {
    flex: 1;
    background: transparent;
    border: none;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--aladom-blue-dark);
    width: 80px;
    -moz-appearance: textfield;
    outline: none;
}

.age-input input::-webkit-outer-spin-button,
.age-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.age-suffix {
    padding-right: 18px;
    font-weight: 600;
    color: var(--grey-700);
}

/* ---------- TASKS GRID (multi-select chips) ---------- */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 18px 0 28px;
}

.task-chip {
    background: var(--aladom-blue);
    color: var(--white);
    border-radius: var(--radius-pill);
    padding: 12px 18px 12px 38px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    transition: var(--transition);
    position: relative;
    line-height: 1.3;
}

.task-chip::before {
    content: '+';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.task-chip:hover {
    background: var(--aladom-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.task-chip.selected {
    background: var(--aladom-blue-dark);
}

.task-chip.selected::before { content: '−'; }

/* ---------- FREQUENCY ---------- */
.freq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 22px 0 28px;
}

.freq-card {
    position: relative;
    padding: 14px 16px;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 600;
    color: var(--aladom-blue-dark);
    font-size: 14px;
    background: var(--white);
}

.freq-card input { position: absolute; opacity: 0; pointer-events: none; }

.freq-card:hover {
    border-color: var(--aladom-blue);
    background: var(--aladom-blue-soft);
}

.freq-card:has(input:checked) {
    background: var(--aladom-blue);
    border-color: var(--aladom-blue);
    color: var(--white);
    box-shadow: var(--shadow-soft);
}

/* ---------- FORM FIELDS ---------- */
.civilite {
    border: none;
    margin: 18px 0 22px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.civilite legend {
    font-weight: 600;
    color: var(--aladom-blue-dark);
    margin-bottom: 8px;
    width: 100%;
}

.civilite label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    color: var(--grey-700);
}

.civilite input[type="radio"] { accent-color: var(--aladom-blue); width: 18px; height: 18px; }

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }

.field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-700);
}

.field input {
    padding: 12px 14px;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: var(--transition);
    color: var(--aladom-blue-dark);
    font-size: 15px;
    outline: none;
}

.field input:focus {
    border-color: var(--aladom-blue);
    box-shadow: 0 0 0 3px rgba(26, 109, 255, 0.15);
}

.field input:invalid:not(:placeholder-shown) {
    border-color: #E94B4B;
}

/* ---------- BUTTONS ---------- */
.step-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--aladom-blue);
    color: var(--white);
    box-shadow: 0 8px 20px -8px rgba(26, 109, 255, 0.5);
}

.btn-primary:hover {
    background: var(--aladom-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(10, 37, 64, 0.5);
}

.btn-primary:disabled {
    background: var(--grey-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-finaliser { width: 100%; padding: 16px; font-size: 16px; }

.legal {
    margin-top: 16px;
    font-size: 12px;
    color: var(--grey-500);
    line-height: 1.5;
}

/* ---------- SUCCESS ---------- */
.step-success {
    text-align: center;
    padding: 24px 0;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--green-mid));
    color: var(--white);
    font-size: 36px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    animation: pop 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--aladom-blue-dark);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    height: 32px;
    filter: brightness(0) invert(1);
}

.footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.footer-legal {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    max-width: 760px;
    line-height: 1.55;
}

.footer-links {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0 4px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--cyan);
    text-decoration: underline;
}

/* ---------- LEGAL PAGES ---------- */
.legal-page {
    padding: 56px 0 72px;
    background: var(--white);
    color: var(--grey-700);
}

.legal-page .container { max-width: 820px; }

.legal-page h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    color: var(--aladom-blue-dark);
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    line-height: 1.15;
}

.legal-page section + section { margin-top: 8px; }

.legal-page h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--aladom-blue-dark);
    letter-spacing: -0.01em;
    margin: 36px 0 12px;
}

.legal-page h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--aladom-blue);
    margin: 22px 0 8px;
}

.legal-page h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--aladom-blue-dark);
    margin: 18px 0 6px;
}

.legal-page h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--grey-700);
    margin: 14px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legal-page p {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 14px;
}

.legal-page ul {
    margin: 8px 0 18px 22px;
    font-size: 15px;
    line-height: 1.65;
}

.legal-page li { margin-bottom: 6px; }

.legal-page a {
    color: var(--aladom-blue);
    text-decoration: underline;
}

.legal-page a:hover { text-decoration: none; }

.legal-page .back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--grey-500);
    margin-bottom: 18px;
    text-decoration: none;
    transition: var(--transition);
}

.legal-page .back-home:hover { color: var(--aladom-blue); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .hero { min-height: auto; padding: 40px 0 60px; }

    .hero-text { text-align: center; }
    .hero-title { margin-left: auto; margin-right: auto; }
    .hero-promo { margin: 0 auto; }

    .funnel { max-width: 640px; margin: 0 auto; }
}

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .site-header { padding: 14px 0; }
    .header-inner { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
    .header-tagline { font-size: 16px; }
    .logo { height: 48px; }

    .hero { padding: 28px 0 48px; }

    /* Pas d'image de fond sur mobile : décision client du 2026-05-19 */
    .hero-bg { display: none; }

    /* Le funnel passe en premier ; le texte du hero est rejeté en dessous */
    .hero-text { order: 2; }

    .hero-title { font-size: 26px; margin-bottom: 28px; }

    /* Sur mobile : le cadre bleu se limite à la phrase ; la bulle 50% est en dehors, en dessous */
    .hero-promo {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        max-width: 100%;
    }

    .hero-banner {
        padding: 12px 22px;
    }

    .hero-banner-text { padding-right: 0; font-size: 14px; }

    .hero-bubble {
        position: static;
        width: 110px;
        height: 110px;
        transform: none;
    }

    .bubble-percent { font-size: 24px; }

    @keyframes bubble-pulse {
        0%, 100% { transform: scale(1); }
        50%      { transform: scale(1.04); }
    }

    .funnel { order: 1; padding: 24px 18px 22px; border-radius: var(--radius-md); }

    /* Barre de progression mobile : les 3 libellés sont visibles dès le début.
       Police et paddings réduits pour que « Qui aider ? » tienne en entier ;
       la flèche est masquée pour libérer de la place (l'état actif reste lisible
       grâce au fond bleu foncé). « Tâches à réaliser » peut passer sur 2 lignes. */
    .progress { padding: 4px; gap: 3px; align-items: stretch; }
    .progress-step { padding: 5px 7px; font-size: 10px; gap: 4px; line-height: 1.15; }
    .progress-num { width: 20px; height: 20px; font-size: 11px; }
    .progress-label { white-space: normal; }
    .progress-arrow { display: none; }

    .step-title { font-size: 18px; }

    .choice-grid { grid-template-columns: 1fr; }
    .choice-grid-3 { grid-template-columns: 1fr; }

    .tasks-grid { grid-template-columns: 1fr; }

    .freq-grid { grid-template-columns: 1fr 1fr; }

    .field-grid { grid-template-columns: 1fr; }

    .age-input { max-width: 100%; }
    .age-input input { width: 60px; font-size: 18px; }

    .btn { width: 100%; }
    .step-actions { width: 100%; }
    .step-actions .btn { width: 100%; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
