/* ============================================================
   contact.css — SAV de la vitrine : /contact et le fil d'une demande
   (/contact/repondre/{token}). Posé sur auth.css (carte, champs).
   ============================================================ */

.form-field textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    min-height: 120px;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.form-field textarea:focus {
    outline: none;
    border-color: var(--belt-yellow);
    box-shadow: 0 0 0 3px rgba(252, 192, 43, 0.15);
}

/* Champ piège : hors de l'écran plutôt que display:none, que certains robots savent ignorer. */
.contact-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-note {
    margin: 20px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* === Fil d'une demande === */
.contact-thread-card {
    max-width: 680px;
}

.contact-loading {
    color: var(--text-muted);
    text-align: center;
    padding: 24px 0;
}

.contact-reference {
    margin: -12px 0 20px;
    font-size: 13px;
    color: var(--text-soft);
}

.contact-messages {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-message {
    max-width: 88%;
    align-self: flex-start;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.contact-message.is-mine {
    align-self: flex-end;
    background: rgba(199, 224, 224, 0.45);
    border-color: var(--primary-light);
}

.contact-message-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.contact-message-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
    line-height: 1.5;
    color: var(--text);
}

.contact-message-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* === Pièces jointes (miroir d'AttachmentPicker / AttachmentList de l'app) === */
.contact-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.contact-attach-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.contact-attach {
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
}
.contact-attach:disabled {
    opacity: 0.5;
    cursor: default;
}

.contact-attach-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* Un fichier glissé au-dessus du champ du message. */
.form-field.is-dragging textarea {
    border-style: dashed;
    border-color: var(--primary);
    background: var(--bg-soft);
}

.contact-pending {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 4px 4px 6px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg-soft);
    font-size: 14px;
}
.contact-pending-item img {
    flex-shrink: 0;
    width: 48px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-muted);
}

.contact-pending-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.contact-pending-size,
.contact-file-size {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.contact-pending-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.contact-pending-remove:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.contact-file-badge {
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--belt-dark-red);
}

.contact-attachment-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-thumb {
    display: block;
    width: 120px;
    height: 90px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg);
    overflow: hidden;
    cursor: zoom-in;
}
.contact-thumb:hover {
    border-color: var(--primary);
}
.contact-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    height: 40px;
    padding: 0 12px 0 0;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
}
.contact-file:hover {
    border-color: var(--primary);
}

.contact-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
