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

:root {
    --bleu-noir : #001932;
    --rose      : #e2017a;
    --bleu      : #019ee0;
    --jaune     : #ffed00;
    --gris-clair: #f4f6f8;
    --gris-bord : #dde2e8;
    --texte     : #1a2332;
    --rayon     : 12px;
    --ombre     : 0 4px 20px rgba(0,25,50,.10);
}

html, body {
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background : var(--gris-clair);
    color      : var(--texte);
    font-size  : 1rem;
    line-height: 1.6;
}

/* ---- header ---- */
.site-header {
    background: var(--bleu-noir);
    color      : #fff;
    padding    : 16px 20px;
}

.header-inner {
    max-width      : 700px;
    margin         : 0 auto;
    display        : flex;
    flex-direction : column;
    gap            : 10px;
}

.site-header h1 {
    font-size  : clamp(1.2rem, 5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -.5px;
}

.profil-badge {
    display        : flex;
    align-items    : center;
    gap            : 8px;
    background     : rgba(255,255,255,.08);
    border-radius  : 8px;
    padding        : 6px 12px;
    align-self     : flex-start;
}

.profil-label {
    font-size  : .75rem;
    opacity    : .7;
    white-space: nowrap;
}

.profil-code {
    font-weight   : 700;
    color         : var(--jaune);
    letter-spacing: .5px;
    font-size     : .9rem;
}

/* ---- container ---- */
.container {
    max-width: 700px;
    margin   : 0 auto;
    padding  : 24px 16px 60px;
}

/* ---- étapes ---- */
.etape {
    display: none;
}

.etape.active {
    display: block;
}

/* ---- saisie initiale ---- */
.intro-text {
    font-size    : clamp(.95rem, 3vw, 1.1rem);
    margin-bottom: 20px;
    color        : #445;
}

.saisie-bloc {
    display       : flex;
    flex-direction: column;
    gap           : 12px;
}

textarea {
    width        : 100%;
    padding      : 14px 16px;
    border       : 2px solid var(--gris-bord);
    border-radius: var(--rayon);
    font-size    : 1rem;
    font-family  : inherit;
    resize       : vertical;
    transition   : border-color .2s;
    background   : #fff;
}

textarea:focus {
    outline      : none;
    border-color : var(--bleu);
}

/* ---- bouton principal ---- */
.btn-principal {
    align-self   : flex-end;
    padding      : 12px 28px;
    background   : var(--rose);
    color        : #fff;
    border       : none;
    border-radius: var(--rayon);
    font-size    : 1rem;
    font-weight  : 700;
    cursor       : pointer;
    transition   : background .2s, transform .1s;
}

.btn-principal:hover {
    background: #c4006b;
}

.btn-principal:active {
    transform: scale(.97);
}

/* ---- carte idée ---- */
.contexte-tag {
    display      : inline-block;
    background   : var(--bleu-noir);
    color        : #fff;
    font-size    : .8rem;
    padding      : 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.carte-idee {
    background   : #fff;
    border-radius: var(--rayon);
    box-shadow   : var(--ombre);
    padding      : 28px 24px;
    min-height   : 180px;
    display      : flex;
    align-items  : center;
    justify-content: center;
    margin-bottom: 20px;
}

/* ---- loading ---- */
.loading {
    display    : flex;
    align-items: center;
    gap        : 12px;
    color      : #778;
    font-size  : .95rem;
}

.loading-spinner {
    width        : 22px;
    height       : 22px;
    border       : 3px solid var(--gris-bord);
    border-top   : 3px solid var(--bleu);
    border-radius: 50%;
    animation    : spin .7s linear infinite;
    flex-shrink  : 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- contenu idée ---- */
.idee-contenu {
    width: 100%;
}

.idee-titre {
    font-size    : clamp(1.1rem, 4vw, 1.4rem);
    font-weight  : 700;
    color        : var(--bleu-noir);
    margin-bottom: 12px;
    line-height  : 1.3;
}

.idee-corps {
    color    : #445;
    font-size: clamp(.9rem, 3vw, 1rem);
}

/* ---- actions principales ---- */
.actions-principales {
    display: flex;
    gap    : 12px;
    margin-bottom: 12px;
}

.btn-action {
    flex          : 1;
    display       : flex;
    flex-direction: column;
    align-items   : center;
    gap           : 6px;
    padding       : 18px 12px;
    border        : none;
    border-radius : var(--rayon);
    font-size     : 1rem;
    font-weight   : 700;
    cursor        : pointer;
    transition    : background .2s, transform .1s, opacity .2s;
}

.btn-action:disabled {
    opacity: .4;
    cursor : not-allowed;
}

.btn-action:not(:disabled):active {
    transform: scale(.96);
}

.btn-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.btn-garder {
    background: #e6f9f0;
    color     : #1a7f4a;
}

.btn-garder:not(:disabled):hover {
    background: #d0f2e3;
}

.btn-refuser {
    background: #fdeaea;
    color     : #c0392b;
}

.btn-refuser:not(:disabled):hover {
    background: #fad4d4;
}

/* ---- actions secondaires ---- */
.actions-secondaires {
    text-align   : center;
    margin-bottom: 28px;
}

.lien-action {
    background : none;
    border     : none;
    color      : #778;
    font-size  : .85rem;
    cursor     : pointer;
    text-decoration: underline;
    padding    : 4px;
    transition : color .2s;
}

.lien-action:hover:not(:disabled) {
    color: var(--bleu);
}

.lien-action:disabled {
    opacity: .4;
    cursor : not-allowed;
}

/* ---- historique ---- */
.bloc-historique {
    display      : none;
    background   : #fff;
    border-radius: var(--rayon);
    box-shadow   : var(--ombre);
    padding      : 20px 24px;
    margin-bottom: 20px;
}

.bloc-historique h2 {
    font-size    : 1rem;
    font-weight  : 700;
    margin-bottom: 12px;
    color        : var(--bleu-noir);
}

.bloc-historique ul {
    list-style : none;
    display    : flex;
    flex-direction: column;
    gap        : 8px;
}

.bloc-historique li {
    padding      : 10px 14px;
    background   : #e6f9f0;
    border-radius: 8px;
    font-size    : .9rem;
    color        : #1a7f4a;
    font-weight  : 600;
}

/* ---- sauvegarde ---- */
.bloc-sauvegarde {
    display       : flex;
    flex-direction: column;
    gap           : 12px;
}

.btn-secondaire {
    display      : inline-block;
    padding      : 10px 22px;
    background   : transparent;
    border       : 2px solid var(--bleu-noir);
    color        : var(--bleu-noir);
    border-radius: var(--rayon);
    font-size    : .9rem;
    font-weight  : 700;
    cursor       : pointer;
    text-decoration: none;
    transition   : background .2s, color .2s;
    align-self   : flex-start;
}

.btn-secondaire:hover {
    background: var(--bleu-noir);
    color     : #fff;
}

.lien-sauvegarde-bloc {
    display    : flex;
    flex-wrap  : wrap;
    align-items: center;
    gap        : 8px;
    font-size  : .85rem;
    background : #fff;
    border     : 1px solid var(--gris-bord);
    border-radius: 8px;
    padding    : 10px 14px;
}

.lien-sauvegarde-bloc a {
    color         : var(--bleu);
    word-break    : break-all;
    text-decoration: none;
}

.lien-sauvegarde-bloc a:hover {
    text-decoration: underline;
}

.btn-copier {
    padding      : 4px 12px;
    background   : var(--bleu-noir);
    color        : #fff;
    border       : none;
    border-radius: 6px;
    font-size    : .8rem;
    cursor       : pointer;
    white-space  : nowrap;
    transition   : background .2s;
}

.btn-copier:hover {
    background: #003366;
}

/* ---- messages d'erreur ---- */
.erreur-msg {
    color    : #c0392b;
    font-size: .95rem;
    padding  : 12px;
    background: #fdeaea;
    border-radius: 8px;
}

/* ---- page view ---- */
.view-meta {
    background   : #fff;
    border-radius: var(--rayon);
    padding      : 20px 24px;
    margin-bottom: 20px;
    box-shadow   : var(--ombre);
}

.view-date {
    font-size: .85rem;
    color    : #778;
    margin-top: 6px;
}

.view-section {
    margin-bottom: 24px;
}

.view-section h2 {
    font-size    : 1rem;
    font-weight  : 700;
    margin-bottom: 12px;
    color        : var(--bleu-noir);
}

.view-liste {
    list-style: none;
    display   : flex;
    flex-direction: column;
    gap       : 8px;
}

.view-item {
    padding      : 12px 16px;
    border-radius: 8px;
}

.view-item strong {
    display: block;
    margin-bottom: 4px;
}

.view-item p {
    font-size: .9rem;
    color    : #445;
}

.view-gardee {
    background: #e6f9f0;
    color     : #1a7f4a;
}

.view-refuser {
    background: #f8f8f8;
    color     : #778;
}

.view-passer {
    background: #f8f8f8;
    color     : #aab;
}

.view-badge {
    font-size    : .75rem;
    font-weight  : 600;
    margin-right : 6px;
    opacity      : .7;
}

.view-cta {
    margin-top: 24px;
}

/* ---- breakpoint 1000px ---- */
@media (min-width: 1000px) {

    .header-inner {
        flex-direction: row;
        align-items   : center;
        justify-content: space-between;
    }

    .saisie-bloc {
        flex-direction: row;
        align-items   : flex-start;
    }

    .saisie-bloc textarea {
        flex: 1;
    }

    .btn-principal {
        align-self: flex-start;
        white-space: nowrap;
    }

    .actions-principales {
        gap: 20px;
    }

    .btn-action {
        padding: 22px 16px;
    }
}
