/* Modale d'enregistrement : la carte de la galerie au centre de l'écran, avec
   le nom et la phrase à remplir. Elle reprend cartes.css pour l'aperçu — une
   seule définition de carte, donc aucun écart possible avec la galerie. */

.sm-fond {
    position: fixed; inset: 0; z-index: 9998;
    display: grid; place-items: center; padding: 24px;
    background: rgba(2, 6, 12, .72);
    backdrop-filter: blur(6px);
    animation: sm-apparition 160ms ease-out;
}
/* L'opacité seule : une animation qui déplace la boîte la laisserait figée
   hors champ si elle ne se jouait pas. */
@keyframes sm-apparition { from { opacity: 0; } to { opacity: 1; } }

.sm-boite {
    width: min(720px, 100%); max-height: 90vh; overflow: auto;
    padding: 26px 28px; border-radius: 18px;
    font: 400 15px/1.5 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
    color: #e7f0fa;
    background: linear-gradient(180deg, #101b28 0%, #0a121c 100%);
    border: 1px solid rgba(46, 226, 122, .35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(46, 226, 122, .1);
}
.sm-boite h2 { margin: 0 0 4px; font-size: 24px; color: #ffffff; }
.sm-sous-titre { margin: 0 0 20px; color: #8fa6bd; font-size: 14px; }

.sm-corps { display: flex; gap: 22px; align-items: flex-start; }
.sm-apercu { width: 236px; flex: none; cursor: default; }
.sm-apercu:hover { transform: none; }

/* La phrase, sous l'auteur, telle qu'elle paraîtra sur la carte. */
.sm-apercu-phrase {
    margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: #b9cbdd;
    font-style: italic; overflow-wrap: anywhere;
}
.sm-apercu-phrase:empty { display: none; }

.sm-champs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sm-champs label {
    font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #8fa6bd;
}
.sm-champs label + * { margin-bottom: 10px; }
.sm-facultatif {
    margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    font-size: 11px; text-transform: none; letter-spacing: 0;
    color: #8fa6bd; border: 1px solid rgba(255, 255, 255, .14);
}
.sm-champs input, .sm-champs textarea {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    font: inherit; color: #ffffff; resize: vertical;
    background: rgba(4, 10, 18, .75);
    border: 1px solid rgba(140, 175, 210, .3);
}
.sm-champs input:focus, .sm-champs textarea:focus {
    outline: none; border-color: var(--vert, #2ee27a);
    box-shadow: 0 0 0 3px rgba(46, 226, 122, .18);
}
.sm-champs input.sm-manque { border-color: #ff7a7a; box-shadow: 0 0 0 3px rgba(255, 122, 122, .18); }
.sm-compteur { align-self: flex-end; font-size: 12px; color: #6f8399; }

.sm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.sm-actions button {
    padding: 11px 22px; border-radius: 11px; cursor: pointer;
    font: 700 15px/1 'Rajdhani', system-ui, sans-serif;
}
.sm-annuler {
    color: #cfe0f0; border: 1px solid rgba(140, 175, 210, .35);
    background: rgba(8, 15, 25, .78);
}
.sm-annuler:hover { border-color: rgba(200, 220, 240, .6); color: #ffffff; }
.sm-valider {
    color: #04240f; border: 1px solid rgba(255, 255, 255, .3);
    background: linear-gradient(180deg, #57f0a0, #16a355);
}
.sm-valider:hover { filter: brightness(1.08); }

/* Étroit : la carte passe au-dessus des champs plutôt que de les écraser. */
@media (max-width: 680px) {
    .sm-corps { flex-direction: column; align-items: stretch; }
    .sm-apercu { width: 100%; max-width: 280px; margin: 0 auto; }
}

/* Avis de connexion : pas d'apercu, donc une boite plus etroite que celle
   de l'enregistrement, et un titre qui tient la promesse du message. */
.sm-boite-courte { max-width: 460px; }
.sm-boite-courte h2 { font-size: 20px; line-height: 1.25; }
.sm-boite-courte .sm-sous-titre { margin-bottom: 18px; }
