/* Contact — même ADN, formulaire utilisable sur tout écran */

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    min-height: 100vh;
    font-family: Montserrat, system-ui, sans-serif;
    color: #fff;
    background-color: #000;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

.sign-page {
    position: relative;
    display: flex;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
}

/* Fixe au viewport : la photo ne bouge pas au scroll, seul le panneau défile */
.td-2 {
    position: fixed;
    inset: 0;
    z-index: 1;
    background-image: url("/img/larochelle.jpg");
    background-size: cover;
    background-position: center;
}

.td-1 {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    background-color: rgba(85, 85, 85, 0.95);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.div-connexion {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    gap: 0.35rem;
    padding: 1rem 1.25rem 1.5rem;
}

.logo-sign {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-sign img,
.logo-img {
    width: auto;
    max-width: min(180px, 50vw);
    height: auto;
}

.sign-page h1 {
    margin: 0.35rem 0 0.65rem;
    text-align: center;
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    font-family: Montserrat-Bold, Montserrat, sans-serif;
}

.sign-page form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.sign-page form label {
    display: block;
    font-size: clamp(0.88rem, 2.2vw, 1rem);
    margin-top: 0.35rem;
}

.sign-page input[type="text"],
.sign-page input[type="email"],
.sign-page input[type="tel"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 2.75rem;
    padding: 0.35rem 0.6rem;
    margin-top: 0.2rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.sign-page input:focus,
#msg:focus {
    outline: 2px solid #b1ea0c;
    outline-offset: 1px;
}

#msg {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 7rem;
    margin-top: 0.2rem;
    padding: 0.5rem 0.6rem;
    resize: vertical;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

/* Pièces jointes : input natif masqué + bouton sur mesure (ADN Lotixam) */
.attachments-block {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.attachments-block__title {
    display: block;
    font-size: clamp(0.88rem, 2.2vw, 1rem);
    margin-bottom: 0.65rem;
    font-family: Montserrat-Bold, Montserrat, sans-serif;
}

.attachments-block__hint {
    font-weight: normal;
    font-family: Montserrat, system-ui, sans-serif;
    opacity: 0.75;
    font-size: 0.92em;
}

.file-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.55rem;
}

.file-picker:last-child {
    margin-bottom: 0;
}

.file-picker__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-picker:focus-within .file-picker__btn {
    outline: 2px solid #b1ea0c;
    outline-offset: 2px;
}

.file-picker__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.45rem 1.15rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: Montserrat-Bold, Montserrat, sans-serif;
    color: #fff;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.file-picker__btn:hover {
    color: #b1ea0c;
    border-color: #b1ea0c;
    background: rgba(177, 234, 12, 0.08);
}

.file-picker__name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.attachment-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-row.file-picker {
    align-items: center;
}

.attachment-remove {
    flex-shrink: 0;
    margin-left: 0.35rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.attachment-remove:hover {
    border-color: #f87171;
    color: #f87171;
}

.attachments-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.attachments-add-btn {
    background: transparent;
    color: #b1ea0c;
    border: 1px dashed rgba(177, 234, 12, 0.55);
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    font-family: Montserrat, sans-serif;
    cursor: pointer;
    min-height: 40px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.attachments-add-btn:hover:not(:disabled) {
    background: rgba(177, 234, 12, 0.08);
    border-color: #b1ea0c;
}

.attachments-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.attachments-counter {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 420px) {
    .file-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .file-picker__btn {
        width: 100%;
    }

    .file-picker__name {
        white-space: normal;
        word-break: break-word;
    }
}

.back {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.back a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.back a:hover {
    color: #b1ea0c;
}

.submit-zone {
    display: flex;
    justify-content: center;
    margin-top: 0.85rem;
}

.submit-button {
    background-color: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 0.55rem 1.75rem;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-family: Montserrat-Bold, Montserrat, sans-serif;
    cursor: pointer;
    min-height: 44px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.submit-button:hover {
    color: #b1ea0c;
    border-color: #b1ea0c;
}

/* Message de confirmation (hors <pre> pour éviter le HTML invalide) */
.response {
    margin: 0;
    padding: 0;
    font-family: inherit;
    white-space: normal;
    text-align: center;
    color: #b1ea0c;
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.response p {
    margin: 0.35rem 0 0;
}

.response--inline {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(177, 234, 12, 0.45);
    margin-bottom: 0.35rem;
    text-align: center;
}

.lotixam {
    position: absolute;
    bottom: max(12px, env(safe-area-inset-bottom));
    right: max(12px, env(safe-area-inset-right));
    z-index: 3;
    pointer-events: none;
}

.lotixam img {
    width: min(200px, 40vw);
    height: auto;
    display: block;
    opacity: 0.92;
}

/* ——— Mobile : une colonne, carte lisible ——— */
@media (max-width: 991px) {
    .sign-page {
        align-items: flex-start;
        justify-content: center;
        padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    }

    .td-1 {
        width: 100%;
        max-width: 26rem;
        margin-inline: auto;
        border-radius: 16px;
        background-color: rgba(85, 85, 85, 0.9);
        max-height: none;
    }

    .div-connexion {
        padding: 1.15rem 1.15rem 1.35rem;
    }

    .lotixam img {
        width: min(140px, 36vw);
    }
}

/* ——— Bureau : panneau gauche + message à droite ——— */
@media (min-width: 992px) {
    .td-1 {
        width: 40%;
        max-width: 700px;
        min-height: 100dvh;
        min-height: 100vh;
    }

    .div-connexion {
        flex: 1;
        justify-content: center;
        min-height: 0;
        padding: 1.75rem 1.5rem 2rem;
    }

    .submit-zone {
        justify-content: center;
    }
}
