/* ALPIK.Web.MigrateTo — mobile-first, single column, 600px max content (UX §0).
   Brand accent #0077A0 (ALPIK Pro), #EF4136 reserved for danger/SOS only. */

:root {
    --alpik: #0077a0;
    --alpik-dark: #005b7a;
    --danger: #ef4136;
    --navy: #1f2a37;
    --ink: #1f2a37;
    --muted: #5b6570;
    --line: #e2e6ea;
    --bg: #ffffff;
    --amber-bg: #fff4e5;
    --amber-ink: #8a5300;
    --radius: 10px;
    --tap: 48px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;          /* prevents iOS zoom on inputs (UX §0) */
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.skiplink {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--alpik);
    color: #fff;
    padding: 12px 16px;
    z-index: 100;
}
.skiplink:focus { left: 8px; top: 8px; }

/* Visible focus outline for keyboard/AT users (UX §0). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--alpik);
    outline-offset: 2px;
}

/* ---- Dry-run banner (safety rail, UX safeguard) ----
   Deliberately OUTSIDE the KIP/ALPIK palette (deep violet + white, hazard stripe) so it can never be
   mistaken for normal brand chrome. Sticky to the top so it stays visible on every screen. */
.dryrun-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #4a1d96;               /* deep violet — not blue/navy/red/amber */
    color: #ffffff;
    border-bottom: 4px solid #f5c518;  /* high-visibility hazard accent */
    font-weight: 600;
    line-height: 1.35;
}
.dryrun-banner__badge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f5c518;
    color: #1f2a37;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.dryrun-banner__text { font-size: 14px; }

/* ---- Header / brand ---- */
.app-header { border-bottom: 1px solid var(--line); }
.app-header__inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-header--kip { background: var(--navy); }
.app-header--kip .wordmark { color: #fff; }
.wordmark { font-weight: 800; letter-spacing: .5px; font-size: 20px; }
.wordmark--kip .wordmark__sub {
    font-size: 12px; font-weight: 600; margin-left: 6px; color: #61d0e6; letter-spacing: 2px;
}
.wordmark--kipbadge {
    font-size: 12px; background: var(--navy); color: #fff;
    padding: 3px 8px; border-radius: 6px; letter-spacing: 2px;
}
.wordmark--alpik { color: var(--alpik); }
.wordmark--alpik .wordmark__pro { color: var(--muted); font-weight: 600; }

/* ---- Step indicator (UX §0) ---- */
.steps { border-bottom: 1px solid var(--line); background: #fafbfc; }
.steps__list {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 8px;
    display: flex;
    list-style: none;
    gap: 4px;
}
.steps__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
}
.steps__dot {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 13px; font-weight: 700;
    border: 2px solid var(--line);
    color: var(--muted);
    background: #fff;
}
.steps__label {
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
/* KIP phase: filled navy dots with a subtle shadow. */
.steps__item--kip.steps__item--done .steps__dot,
.steps__item--kip.steps__item--current .steps__dot {
    background: var(--navy); border-color: var(--navy); color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
/* Transition phase: flat teal outline, no shadow. */
.steps__item--transition.steps__item--done .steps__dot,
.steps__item--transition.steps__item--current .steps__dot {
    background: #fff; border-color: var(--alpik); color: var(--alpik); box-shadow: none;
}
/* ALPIK phase: monoline teal, filled when reached. */
.steps__item--alpik.steps__item--done .steps__dot,
.steps__item--alpik.steps__item--current .steps__dot {
    background: var(--alpik); border-color: var(--alpik); color: #fff;
}
.steps__item--current .steps__label { color: var(--ink); font-weight: 700; }

/* ---- Main / layout ---- */
.app-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 96px;   /* bottom padding reserves space for sticky bar (UX §1) */
}

h1 { font-size: 24px; line-height: 1.3; margin: 0 0 12px; }
h2 { font-size: 20px; line-height: 1.35; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--muted); }

.hero {
    background: linear-gradient(135deg, #12303f, #0077a0);
    color: #fff;
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 20px;
}
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255,255,255,.9); }
.hero__img {
    width: 100%;
}

/* ---- "Pourquoi" / "Comment" blocks ---- */
.reasons { list-style: none; padding: 0; margin: 0 0 12px; }
.reasons li {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.reasons .icon {
    flex: 0 0 auto; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #eef7fb; color: var(--alpik); font-size: 20px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 0 16px;
}
.recap { list-style: none; padding: 0; margin: 0; }
.recap li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.recap li:last-child { border-bottom: none; }

/* ---- Buttons (min 48px tap target, UX §0/H2) ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%;
    min-height: var(--tap);
    padding: 12px 16px;
    font-size: 16px; font-weight: 700;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn + .btn { margin-top: 10px; }
.btn--primary { background: var(--alpik); color: #fff; border-color: var(--alpik); }
.btn--primary:hover { background: var(--alpik-dark); border-color: var(--alpik-dark); }
.btn--outline { background: #fff; color: var(--alpik); border-color: var(--alpik); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn:disabled, .btn[aria-disabled="true"] {
    background: #cfd6db; border-color: #cfd6db; color: #6b7480; cursor: not-allowed;
}

.btn-help { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

/* ---- Sticky bottom action bar (UX §0) ---- */
.sticky-actions {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
}
.sticky-actions__inner { max-width: 600px; margin: 0 auto; }

/* ---- Consent / T&Cs ---- */
.terms-panel {
    max-height: 40vh;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}
.consent {
    display: flex; align-items: center; gap: 12px;
    min-height: var(--tap);
    padding: 8px 0;
    cursor: pointer;
}
.consent input[type="checkbox"] { width: 24px; height: 24px; flex: 0 0 auto; }

/* ---- Alerts ---- */
.alert {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 0 0 16px;
}
.alert--warning { background: var(--amber-bg); color: var(--amber-ink); border: 1px solid #f0d9b5; }
.note { color: var(--muted); font-size: 14px; }

/* ---- Reference code (error screen, UX §6) ---- */
.refcode {
    display: flex; align-items: center; gap: 10px;
    background: #f5f7f9; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin: 12px 0;
}
.refcode code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; }
.refcode button { width: auto; min-height: 40px; padding: 6px 14px; }

/* ---- Loading spinner (UX §5) ---- */
.loading { text-align: center; padding: 40px 0; }
.spinner {
    width: 48px; height: 48px; margin: 0 auto 20px;
    border: 4px solid var(--line); border-top-color: var(--alpik);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@@keyframes spin { to { transform: rotate(360deg); } }
@@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---- Footer ---- */
.app-footer { border-top: 1px solid var(--line); background: #fafbfc; }
.app-footer__inner {
    max-width: 600px; margin: 0 auto; padding: 16px;
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 13px; color: var(--muted);
}

/* ---- Email preview ---- */
.email-preview {
    border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 16px; margin: 0 0 20px; background: #fcfdfe;
}
.email-preview__meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
