/* ============================================================
   signup.css — Parcours de création de compte éditeur (self-care)
   Repris de memory/domain/creation-compte-selfcare.html (mobile d'abord)
   ============================================================ */

:root {
    --primary-color: #1e293b;
    --primary-hover: #0f172a;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #d1fae5;
    --success-text: #047857;
    --danger-color: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fee2e2;
    --info-bg: #eff6ff;
    --info-border: #dbeafe;
    --warn-bg: #fffbeb;
    --warn-border: #fcd34d;
    --warn-text: #b45309;
    --shadow-cta: 0 4px 6px -1px rgba(30, 41, 59, 0.2);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}

[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; }

.stage {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 560px;
    padding: 2.5rem;
}

/* Logo animé (signature de marque) */
.logo-bar { position: relative; width: 60px; height: 8px; border-radius: 999px; overflow: hidden; margin: 0 auto; }
.logo-bar .layer { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0 999px 999px 0; }
.layer-4 { width: 100%; background: #ff5e4d; z-index: 1; }
.layer-3 { background: #fa9e4f; z-index: 2; animation: flow-orange 4s ease-in-out infinite alternate 0.2s; }
.layer-2 { background: #f9d448; z-index: 3; animation: flow-jaune 4s ease-in-out infinite alternate 0.1s; }
.layer-1 { background: #17c3a5; z-index: 4; border-radius: 999px; animation: flow-vert 4s ease-in-out infinite alternate; }
@keyframes flow-vert { 0%, 100% { width: 22%; } 50% { width: 42%; } }
@keyframes flow-jaune { 0%, 100% { width: 48%; } 50% { width: 66%; } }
@keyframes flow-orange { 0%, 100% { width: 74%; } 50% { width: 90%; } }
.brand { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; margin-bottom: 1.75rem; }
.wordmark { font-family: 'Montserrat Alternates', sans-serif; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; color: var(--text-dark); }

.head { text-align: center; margin-bottom: 1.75rem; }
.head h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.head p { color: var(--text-light); font-size: 0.9375rem; }
/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.75rem; }
.step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.step .dot {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; flex-shrink: 0; background: #fff;
}
.step.active { color: var(--text-dark); }
.step.active .dot { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.step.done { color: var(--success-text); }
.step.done .dot { background: var(--success-color); border-color: var(--success-color); color: #fff; }
.step.done .dot svg { width: 13px; height: 13px; }
.step-line { flex: 1; height: 2px; background: var(--border-color); border-radius: 2px; min-width: 12px; }
.step-line.done { background: var(--success-color); }

/* ---------- Formulaire ---------- */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.field { text-align: left; min-width: 0; }
.field label.lbl { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.req { color: var(--danger-color); margin-left: 2px; }
.optional { font-weight: 400; color: var(--text-muted); font-size: 0.8125rem; }

.input-wrap { position: relative; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field select {
    width: 100%;
    min-height: 48px;                /* cible tactile confortable */
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;                 /* 16px : évite le zoom auto d'iOS */
    color: var(--text-dark);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.field input:focus, .field select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1); }
.field.valid input { border-color: #6ee7b7; }
.field.invalid input { border-color: var(--danger-color); }
.input-wrap .has-suffix { padding-right: 3rem !important; }
.suffix-btn, .suffix-icon {
    position: absolute; right: 0; top: 0; bottom: 0; width: 48px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); background: none; border: none; cursor: pointer;
}
.suffix-icon { pointer-events: none; }
.suffix-btn svg, .suffix-icon svg { width: 18px; height: 18px; }
.field.valid .suffix-icon { color: var(--success-color); }
.field.invalid .suffix-icon { color: var(--danger-color); }

.hint { font-size: 0.8125rem; color: var(--text-light); margin-top: 0.5rem; line-height: 1.45; }
.hint code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 0.8125rem; color: var(--text-dark); }
.msg { font-size: 0.8125rem; margin-top: 0.5rem; display: none; align-items: flex-start; gap: 0.375rem; }
.msg svg { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }
.msg.show { display: flex; }
.msg.err { color: var(--danger-color); }
.msg.ok { color: var(--success-text); }

/* Force du mot de passe */
.pw-meter { display: flex; gap: 4px; margin-top: 0.625rem; }
.pw-meter span { flex: 1; height: 4px; border-radius: 4px; background: var(--border-color); transition: background 0.2s; }
.pw-rules { display: flex; flex-wrap: wrap; gap: 0.375rem 0.75rem; margin-top: 0.5rem; }
.pw-rules span { font-size: 0.75rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.25rem; }
.pw-rules span svg { width: 12px; height: 12px; }
.pw-rules span.ok { color: var(--success-text); }

/* Checkbox (identique à login.html) */
.check { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; text-align: left; }
.check input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 22px; height: 22px; min-width: 22px; margin-top: 1px;
    border: 1.5px solid var(--border-color); border-radius: 5px;
    background: #fff; cursor: pointer; position: relative; transition: all 0.2s;
}
.check input[type=checkbox]:checked { background: var(--primary-color); border-color: var(--primary-color); }
.check input[type=checkbox]:checked::after {
    content: ''; position: absolute; left: 6.5px; top: 2px; width: 6px; height: 11px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check span { font-size: 0.875rem; color: var(--text-light); line-height: 1.5; user-select: none; }
.check a { color: var(--primary-color); font-weight: 600; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 52px; padding: 0.875rem 1.5rem; width: 100%;
    border-radius: 0.5rem; border: none; cursor: pointer;
    font-size: 1rem; font-weight: 600; text-decoration: none;
    transition: all 0.2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #fff; color: var(--text-dark); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: #f1f5f9; }
.btn-ghost { background: none; color: var(--text-light); min-height: 44px; font-weight: 500; font-size: 0.875rem; width: auto; }
.btn-ghost:hover { color: var(--primary-color); }

.actions { margin-top: 0.5rem; }
.foot { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-light); }
.foot a { color: var(--primary-color); font-weight: 600; text-decoration: none; }

/* Séparateur de section (micro-label) */
.section-label {
    font-size: 0.75rem; font-weight: 600; color: var(--text-light);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding-top: 0.5rem; border-top: 1px solid #f1f5f9; margin-top: 0.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.section-label:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* Bandeaux info */
.info-box {
    display: flex; gap: 0.75rem; align-items: flex-start; text-align: left;
    background: #f8fafc; border: 1px solid var(--border-color); border-radius: 0.75rem;
    padding: 1rem; font-size: 0.875rem; line-height: 1.5;
}
.info-box > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--primary-color); }
.info-box.blue { background: var(--info-bg); border-color: var(--info-border); }
.info-box.green { background: var(--success-bg); border-color: var(--success-border); }
.info-box.green > svg { color: var(--success-color); }
.info-box.amber { background: var(--warn-bg); border-color: var(--warn-border); }
.info-box.amber > svg { color: var(--warn-text); }
.info-box strong { font-weight: 600; }
/* ---------- Écran vérification email ---------- */
.center { text-align: center; }
.mail-icon {
    width: 72px; height: 72px; border-radius: 50%; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
    animation: pulseRing 2s ease-out infinite;
}
.mail-icon svg { width: 32px; height: 32px; color: var(--primary-color); }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(30, 41, 59, 0.15); } 100% { box-shadow: 0 0 0 20px rgba(30, 41, 59, 0); } }
.email-pill {
    display: inline-block; max-width: 100%; overflow-wrap: anywhere;
    background: #f1f5f9; border: 1px solid var(--border-color); border-radius: 999px;
    padding: 0.375rem 1rem; font-weight: 600; font-size: 0.9375rem; margin: 0.75rem 0 0.25rem;
}
.stack { display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------- Animation succès (identique campagne_success) ---------- */
.checkmark-wrapper {
    width: 80px; height: 80px; border-radius: 50%; display: block; margin: 0 auto 1.5rem;
    stroke-width: 2; stroke: #fff; stroke-miterlimit: 10; box-shadow: inset 0 0 0 #10b981;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}
.checkmark-wrapper.sm { width: 56px; height: 56px; margin-bottom: 1rem; }
.checkmark-circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke: #10b981; fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; }
.checkmark-check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; }
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0 0 0 40px #10b981; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.fade-up { opacity: 0; animation: fadeInUp 0.5s ease-out forwards; }
.d1 { animation-delay: 1s; } .d2 { animation-delay: 1.2s; } .d3 { animation-delay: 1.4s; } .d4 { animation-delay: 1.6s; }

.success-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.success-msg { color: var(--text-light); line-height: 1.5; margin-bottom: 1.5rem; }
/* ---------- Code promo ---------- */
.promo-toggle {
    display: flex; align-items: center; gap: 0.5rem; background: none; border: none; padding: 0.5rem 0;
    font-size: 0.875rem; font-weight: 600; color: var(--primary-color); cursor: pointer; min-height: 44px;
}
.promo-toggle svg { width: 16px; height: 16px; }
.promo-toggle .chev { transition: transform 0.2s; }
.promo-toggle[aria-expanded=true] .chev { transform: rotate(180deg); }
.promo-body { display: none; }
.promo-body.open { display: block; animation: screenIn 0.25s ease-out; }
.promo-row { display: flex; gap: 0.5rem; }
.promo-row .input-wrap { flex: 1; min-width: 0; }
.promo-row input { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.promo-row .btn { width: auto; min-height: 48px; padding: 0 1.25rem; }
.promo-hint-btn { background: none; border: none; padding: 0; font: inherit; color: var(--primary-color); font-weight: 600; text-decoration: underline; cursor: pointer; }

.conditions { margin-top: 1rem; border: 1px solid var(--success-border); background: var(--success-bg); border-radius: 0.75rem; padding: 1rem; display: none; }
.conditions.show { display: block; animation: screenIn 0.3s ease-out; }
.cond-head { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--success-text); font-size: 0.9375rem; }
.cond-head svg { width: 18px; height: 18px; }
.cond-head .remove { margin-left: auto; background: none; border: none; color: var(--text-light); font-size: 0.8125rem; cursor: pointer; text-decoration: underline; padding: 0.25rem; min-height: 32px; }
.cond-desc { font-size: 0.875rem; color: var(--text-dark); margin: 0.5rem 0 1rem; }
.timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; position: relative; }
.tl-item { background: #fff; border: 1px solid var(--success-border); border-radius: 0.5rem; padding: 0.75rem; }
.tl-item.now { border-color: #6ee7b7; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12); }
.tl-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }
.tl-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 0.125rem 0; }
.tl-item.now .tl-value { color: var(--success-text); }
.tl-sub { font-size: 0.75rem; color: var(--text-light); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-color); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wrong-mail { text-align: left; margin-top: 1rem; padding: 1rem; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 0.75rem; animation: screenIn 0.25s ease-out; }
.autologin { width: 100%; max-width: 280px; margin: 0 auto; height: 4px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.autologin span { display: block; height: 100%; width: 0; background: var(--success-color); border-radius: 4px; animation: loadbar 2.2s ease-in-out 1.4s forwards; }
@keyframes loadbar { to { width: 100%; } }

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
    .stage { padding: 0.75rem 0.75rem calc(1rem + env(safe-area-inset-bottom)); }
    .card { padding: 1.5rem 1.125rem 1.25rem; border-radius: 1.25rem; }
    .brand { margin-bottom: 1.25rem; }
    .head h1, .success-title { font-size: 1.5rem; }
    .grid-2 { grid-template-columns: 1fr; gap: 1.25rem; }
    .step .label { display: none; }               /* seul le numéro reste visible */
    .step.active .label { display: inline; }      /* sauf pour l'étape courante */
    /* CTA collant en bas d'écran pour les longs formulaires */
    .actions.sticky {
        position: sticky; bottom: 0; z-index: 5;
        margin: 0.5rem -1.125rem -1.25rem; padding: 0.875rem 1.125rem calc(0.875rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
        border-top: 1px solid var(--border-color); border-radius: 0 0 1.25rem 1.25rem;
    }
    .timeline { grid-template-columns: 1fr; }
    .promo-row .btn { padding: 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
    .fade-up { opacity: 1; }
}

@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stage > * { animation: screenIn 0.35s ease-out; }
.noscript-note { margin-top: 1rem; }

/* ALTCHA (anti-robot) : variables du widget alignées sur le design system */
altcha-widget {
    --altcha-color-primary: var(--primary-color);
    --altcha-color-success: var(--success-color);
    --altcha-color-error: var(--danger-color);
    --altcha-border-color: var(--border-color);
    --altcha-border-radius: 8px;
    --altcha-max-width: 100%;
    --altcha-color-base: var(--white);
    --altcha-color-base-content: var(--text-dark);
    font-family: inherit;
    font-size: 0.875rem;
}
