/* ==========================================================
   MON DJASSA — Styles de base (mobile first)
   Variables et breakpoints : voir CLAUDE.md §6 et §10.3
   ========================================================== */

:root {
    --primary: #FF7F00;
    --primary-dark: #CC6600;
    --primary-light: #FFA34D;

    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;

    --purple: #6F42C1;
    --pink: #E83E8C;

    --dark: #2D2D2D;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --text: #1e2b3c;
    --text-soft: #4a5a6e;
    --border: #e1e5eb;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    --container-padding: 16px;
    --container-max-width: 100%;
    --font-base: 14px;
    --touch-target: 44px;

    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (min-width: 768px) {
    :root {
        --container-padding: 24px;
        --container-max-width: 720px;
        --font-base: 15px;
    }
}

@media (min-width: 1024px) {
    :root {
        --container-padding: 32px;
        --container-max-width: 960px;
        --font-base: 16px;
    }
}

@media (min-width: 1440px) {
    :root { --container-max-width: 1280px; }
}

@media (min-width: 1920px) {
    :root {
        --container-max-width: 1440px;
        --font-base: 17px;
    }
}

@media (min-width: 2560px) {
    :root {
        --container-max-width: 1760px;
        --font-base: 18px;
    }
}

@media (min-width: 3840px) {
    :root { --font-base: 22px; }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--light);
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* ---------- Typographie fluide ---------- */
h1, h2, h3 {
    margin: 0 0 0.5em;
    line-height: 1.2;
}

h1 { font-size: clamp(1.75rem, 5vw + 1rem, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw + 0.5rem, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw + 0.25rem, 1.75rem); }
p  { margin: 0 0 1em; font-size: clamp(0.95rem, 1vw + 0.5rem, 1.125rem); }

a {
    color: var(--primary-dark);
}

a:hover,
a:focus-visible {
    color: var(--primary);
}

:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.nowrap { white-space: nowrap; }

/* ---------- Conteneur ---------- */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-target);
    padding: 10px 20px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn:disabled,
.btn[aria-busy="true"] {
    opacity: 0.65;
    cursor: wait;
}

.btn-primary {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: var(--white);
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline {
    color: var(--primary-dark);
    background: transparent;
    border-color: var(--primary);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    color: var(--white);
    background: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-link {
    min-height: var(--touch-target);
    padding: 0 4px;
    font: inherit;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: underline;
    background: none;
    border: 0;
    cursor: pointer;
}

.btn-link:disabled {
    color: var(--text-soft);
    text-decoration: none;
    cursor: not-allowed;
}

/* ---------- Formulaires ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-control {
    display: block;
    width: 100%;
    min-height: var(--touch-target);
    padding: 10px 14px;
    font: inherit;
    font-size: max(16px, 1em); /* ≥ 16px : évite le zoom automatique sur iOS */
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.2);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-error {
    margin: 6px 0 0;
    font-size: 0.9em;
    color: var(--danger);
}

.form-help {
    margin: 6px 0 0;
    font-size: 0.9em;
    color: var(--text-soft);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-addon {
    flex: 0 0 auto;
    min-width: var(--touch-target);
    padding: 0 12px;
    font-size: 1.1em;
    background: var(--light);
    border: 2px solid var(--border);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

/* ---------- Alertes ---------- */
.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.alert-success { color: #155724; background: #d4edda; border-color: var(--success); }
.alert-danger  { color: #721c24; background: #f8d7da; border-color: var(--danger); }
.alert-warning { color: #6b5100; background: #fff3cd; border-color: var(--warning); }
.alert-info    { color: #0c5460; background: #d1ecf1; border-color: var(--info); }

/* ---------- Boutons complémentaires ---------- */
.btn-sm {
    min-height: 40px;
    padding: 6px 14px;
    font-size: 0.9em;
}

.btn-danger {
    color: var(--white);
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    color: var(--white);
    background: #b02a37;
    border-color: #b02a37;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 999px;
    vertical-align: middle;
}

.badge-premium { color: var(--white); background: var(--purple); }
.badge-danger  { color: var(--white); background: var(--danger); }

/* ---------- Accessibilité ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 1000;
    padding: 10px 16px;
    color: var(--white);
    background: var(--dark);
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 8px;
    color: var(--white);
}

/* ---------- En-tête de l'application ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.app-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--touch-target);
    color: var(--text);
    text-decoration: none;
}

.app-logo-mark {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-logo-text { font-size: 1.15rem; }
.app-logo-text strong { color: var(--primary); }

/* Burger (mobile) */
.app-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: var(--touch-target);
    height: var(--touch-target);
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}

.app-burger span {
    display: block;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.app-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.app-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.app-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Menu : replié sur mobile */
.app-nav {
    display: none;
    flex-basis: 100%;
    padding: 8px 0 16px;
}

.app-nav.is-open {
    display: block;
}

.app-nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-nav-link {
    display: flex;
    align-items: center;
    min-height: var(--touch-target);
    padding: 0 12px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
    color: var(--primary-dark);
    background: var(--light);
}

.app-nav-link.is-active {
    color: var(--primary-dark);
    background: rgba(255, 127, 0, 0.1);
}

.app-nav-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 12px 12px 0;
    border-top: 1px solid var(--border);
}

.app-nav-user form { margin: 0; }

.app-nav-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Menu déplié sur tablette et plus */
@media (min-width: 768px) {
    .app-burger { display: none; }

    .app-nav,
    .app-nav.is-open {
        display: flex;
        flex-basis: auto;
        align-items: center;
        gap: 16px;
        padding: 0;
    }

    .app-nav-list { display: flex; gap: 4px; }

    .app-nav-user {
        margin: 0;
        padding: 0 0 0 16px;
        border-top: 0;
        border-left: 1px solid var(--border);
    }
}

/* ---------- Contenu ---------- */
.app-main {
    padding-block: 24px 40px;
    min-height: calc(100vh - 140px);
}

.app-footer {
    padding: 20px 0;
    font-size: 0.85rem;
    color: var(--text-soft);
    text-align: center;
    border-top: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 0.9em;
    color: var(--text-soft);
}

.page-title {
    margin-bottom: 4px;
    font-size: clamp(1.5rem, 3vw + 0.75rem, 2.25rem);
}

.page-subtitle {
    color: var(--text-soft);
}

/* ---------- Panneaux ---------- */
.panel {
    padding: 20px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.panel-narrow {
    max-width: 640px;
    margin-inline: auto;
}

.panel-center { text-align: center; }
.panel-center .form { text-align: left; }

.panel-title {
    font-size: clamp(1.15rem, 2vw + 0.5rem, 1.4rem);
}

.panel-danger {
    border-color: rgba(220, 53, 69, 0.4);
}

.panel-danger .panel-title { color: var(--danger); }

.panel-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 0;
}

.panel-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-target);
}

@media (min-width: 768px) {
    .panel { padding: 28px; }
}

/* ---------- Formulaires (compléments) ---------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 16px;
}

@media (min-width: 768px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}

.form-fieldset {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.form-label-light { font-weight: 500; }

.required { color: var(--danger); }

select.form-control {
    appearance: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    margin-top: 8px;
}

.form-actions form { margin: 0; }
.form-actions .btn,
.form-actions form .btn { width: 100%; }

@media (min-width: 480px) {
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .form-actions .btn,
    .form-actions form .btn { width: auto; }

    .form-actions-center { justify-content: center; }
}

.form-control-code {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---------- État vide ---------- */
.empty-state {
    max-width: 560px;
    margin: 24px auto;
    padding: 32px 20px;
    text-align: center;
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: clamp(1.2rem, 2vw + 0.75rem, 1.6rem);
}

.muted { color: var(--text-soft); }

.badge-warning { color: #5c4500; background: var(--warning); }
.badge-success { color: var(--white); background: var(--success); }
.badge-info { color: var(--white); background: var(--info); }

/* ---------- Listes d'informations (libellé / valeur) ---------- */
.info-list {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
}

.info-list > div {
    display: grid;
    grid-template-columns: minmax(90px, 35%) 1fr;
    gap: 8px;
}

.info-list dt {
    font-weight: 600;
    color: var(--text-soft);
}

.info-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.section-gap { margin-top: 20px; }

/* ---------- Abonnement ---------- */
.panel-premium {
    border: 2px solid var(--purple);
}

.sub-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
    background: #e9f7ef;
}

.sub-banner.is-warning { border-left-color: var(--warning); background: #fff8e1; }
.sub-banner.is-expired { border-left-color: var(--danger); background: #fdecee; }

.sub-banner-text { flex: 1 1 240px; }

.sms-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
}

.steps {
    margin: 0 0 16px;
    padding-left: 24px;
}

.steps li {
    padding: 6px 0;
    color: var(--text-soft);
}

.steps li.is-done { color: var(--success); font-weight: 600; }
.steps li.is-done::marker { content: "✔ "; }
.steps li.is-current { color: var(--text); font-weight: 700; }

input[type="file"].form-control {
    padding: 8px;
}

.locked-feature {
    max-width: 560px;
    margin: 24px auto;
    padding: 32px 20px;
    text-align: center;
    background: var(--white);
    border: 2px dashed var(--danger);
    border-radius: var(--radius-lg);
}

/* ---------- Accessibilité : mouvements réduits ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Prise en main à distance (support) : bandeau visible sur toutes les pages */
.remote-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px var(--container-padding, 16px);
    font-size: 0.9rem;
    color: #3d2a00;
    background: var(--warning);
    border-bottom: 2px solid var(--primary-dark);
}

.remote-banner span {
    flex: 1 1 260px;
    min-width: 0;
}

.remote-banner-form {
    margin: 0;
}

.remote-banner .btn {
    min-height: var(--touch-target, 44px);
    background: #ffffff;
}
/* ---------- Fil d'étapes de l'inscription (1 infos → 2 code SMS → 3 commerce) ---------- */
.signup-steps {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.signup-step {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-soft);
}

.signup-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    height: 3px;
    background: var(--border);
    border-radius: 3px;
}

.signup-step.is-done:not(:last-child)::after { background: var(--success); }

.signup-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-weight: 700;
    color: var(--text-soft);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.signup-step.is-current { color: var(--primary-dark); }

.signup-step.is-current .signup-dot {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 5px rgba(255, 127, 0, 0.18);
    transform: scale(1.08);
}

.signup-step.is-done { color: var(--success); }

.signup-step.is-done .signup-dot {
    color: var(--white);
    background: var(--success);
    border-color: var(--success);
}

.signup-label {
    max-width: 100%;
    overflow-wrap: anywhere;
}
/* ---------- Prix : promotion (prix barré + badge) et mode gratuit ---------- */
.price-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.price-old { font-size: 0.75em; font-weight: 500; color: var(--text-soft); }
.price-tag.is-promo .price-now { color: var(--danger); }
.price-tag.is-free .price-now { color: var(--success); }
.price-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(120deg, var(--danger), #FF7F00);
    border-radius: 999px;
    animation: price-pulse 2s ease-in-out infinite;
}
.price-tag.is-free .price-badge { background: linear-gradient(120deg, var(--success), #1FB5A8); }

.pricing-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    color: #5a1d00;
    background: linear-gradient(120deg, #FFE8D1, #FFF6EC);
    border: 1px solid #FFC08A;
    border-radius: var(--radius);
}
.pricing-banner.is-free { color: #0f4d2e; background: linear-gradient(120deg, #DFF7E9, #F2FBF6); border-color: #8FD9AE; }
.pricing-banner-icon { flex: 0 0 auto; font-size: 1.4rem; animation: price-pulse 2s ease-in-out infinite; }
.pricing-banner-wrap { padding-top: 12px; }
.pricing-banner-wrap:empty { display: none; }

@keyframes price-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .price-badge, .pricing-banner-icon { animation: none; } }