/* ============================================
   Automafacile — styles responsives
   Approche mobile-first : les règles de base
   ciblent le mobile, les media queries élargissent
   pour tablette et desktop.
   ============================================ */

* {
    box-sizing: border-box;
}

/* ---------- Grille bibliothèque ---------- */

.fa-library-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
    width: 100%;
}

@media (min-width: 600px) {
    .fa-library-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .fa-library-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

.fa-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0; /* empêche le contenu de forcer un débordement */
}

.fa-card h3 {
    font-size: 17px;
    margin: 0 0 8px;
    word-wrap: break-word;
}

.fa-card p {
    font-size: 14px;
    color: #4a4f57;
    flex-grow: 1;
}

.fa-card-locked {
    opacity: 0.7;
}

.fa-badge-locked {
    display: inline-block;
    font-size: 12px;
    background: #f3f4f6;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 20px;
    align-self: flex-start;
}

/* ---------- Boutons ---------- */

.fa-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1f4e79;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    border: none;
    cursor: pointer;
    width: 100%;
    min-height: 44px; /* zone tactile confortable sur mobile */
}

@media (min-width: 600px) {
    .fa-button {
        width: auto;
    }
}

.fa-button:hover {
    background: #163a5c;
    color: #fff;
}

/* ---------- Détail d'un scénario ---------- */

.fa-scenario-detail {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
}

.fa-scenario-detail h2 {
    font-size: 20px;
    line-height: 1.3;
}

@media (min-width: 600px) {
    .fa-scenario-detail h2 {
        font-size: 24px;
    }
}

.fa-scenario-summary {
    font-size: 14px;
    color: #6b7280;
}

.fa-steps-list {
    margin-top: 24px;
}

.fa-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fafbfc;
}

@media (min-width: 600px) {
    .fa-step {
        padding: 16px;
    }
}

.fa-step-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.fa-step-toggle {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    min-width: 32px; /* ne rétrécit jamais sur petits écrans */
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fa-step-content {
    min-width: 0; /* permet au texte de wrapper correctement */
    flex: 1;
}

.fa-step-number {
    font-size: 12px;
    color: #9499a1;
    display: block;
    margin-bottom: 4px;
}

.fa-step-content h4 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

@media (min-width: 600px) {
    .fa-step-content h4 {
        font-size: 16px;
    }
}

.fa-step-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4f57;
    word-wrap: break-word;
}

/* ---------- Message verrouillé ---------- */

.fa-locked-message {
    text-align: center;
    padding: 32px 16px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
}

.fa-locked-message p {
    margin-bottom: 16px;
    font-size: 15px;
}

/* ---------- Formulaire de soumission ---------- */

.fa-submission-form {
    max-width: 600px;
    margin: 0 auto;
}

.fa-submission-form input[type="text"],
.fa-submission-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px; /* évite le zoom automatique iOS sur les champs */
}

.fa-submission-form .fa-step-row {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.fa-submission-form button[type="button"] {
    padding: 10px 16px;
    border: 1px dashed #d1d5db;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    min-height: 44px;
}

@media (min-width: 600px) {
    .fa-submission-form button[type="button"] {
        width: auto;
    }
}

/* ---------- Accessibilité tactile générale ---------- */

@media (max-width: 599px) {
    .fa-card,
    .fa-step,
    .fa-locked-message {
        padding: 14px;
    }
}
