@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900&display=swap');

/* === NORMALISATION DE BASE === */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #ffd89e;
    color: #2e2e2e;
    margin: 20px;
}
*, *::before, *::after {
    box-sizing: border-box;
}

/* === BACKGROUND IMAGE === */
.background-deco {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('logo.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
}

/* === CONTAINER === */
.container {
    display: flex;
    gap: 30px;
    align-items: stretch;
    max-width: 1000px;
    margin: 30px auto;
    flex-wrap: wrap;
}

/* === FORM TITLE === */
.form-title {
    max-width: 1000px;
    margin: 0 auto 30px;
    padding: 15px 20px;
    background-color: #fff9f0;
    color: #2e2e2e;
    text-align: center;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
    user-select: none;
}

/* === FORMULAIRE & RÉCAP === */
form, .recap {
    flex: 1;
    background: #fff9f0;
    padding: 30px 35px;
    border-radius: 50px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* === FORM ELEMENTS === */
input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 8px 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    border-radius: 5px;
    border: 1.5px solid #ccc;
    transition: border-color 0.3s ease;
    margin: 5px 0 13px;
    background-color: white;
    appearance: none;
}
input[type="text"]:focus,
input[type="tel"]:focus,
select:focus {
    border-color: #1e90ff;
    outline: none;
}

/* === VALIDATION === */
input.error, select.error, textarea.error {
    border-color: red;
    background-color: #fff;
    padding-right: 30px;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px 20px;
}
input:valid, select:valid {
    border-color: #2ecc71;
}

/* === MESSAGES D’ERREUR === */
form .error-message {
    color: #d9534f !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    font-style: italic !important;
    margin-top: 4px;
}
label.error-label {
    color: #d9534f;
}

/* === BOUTON SOUMISSION === */
input[type="submit"] {
    background-color: #e6e0ff;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}
input[type="submit"]:hover {
    background-color: #d1caff;
}

/* === TABLEAU RÉCAPITULATIF === */
.recap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    font-weight: 300;
    color: #333;
}
.recap th, .recap td {
    padding: 12px 15px;
    border: 1px solid #ccc;
    text-align: left;
}
.recap th {
    background-color: #e6e0ff;
    color: #000;
    font-weight: 700;
}
.recap tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.03);
}

/* === TITRES & LABELS === */
h2, h3 {
    font-weight: 900;
    color: #1e1e1e;
}
label {
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 8px;
}

/* === BOUTON COPIE === */
.recap button#copyBtn {
    margin-top: 20px;
    align-self: center;
    background-color: #ffd89e;
    color: #000;
    border: 2px solid #fff;
    padding: 10px 25px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-size: 1rem;
}
.recap button#copyBtn:hover {
    background-color: #ff9900;
}

/* === MESSAGE DE COPIE === */
.copy-msg {
    margin-top: 10px;
    color: green;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.copy-msg.show {
    opacity: 1;
}

/* === RESPONSIVE === */
@media screen and (max-width: 960px) {
    .container {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
    }
    form, .recap {
        border-radius: 25px;
        padding: 25px 20px;
    }
    .form-title {
        font-size: 1.4rem;
        padding: 12px 15px;
    }
    .recap button#copyBtn {
        width: 100%;
    }
}

@media screen and (max-width: 500px) {
    input[type="text"],
    input[type="tel"],
    select {
        font-size: 0.95rem;
        padding: 8px 12px;
    }
    .recap table {
        font-size: 0.9rem;
    }
    .form-title {
        font-size: 1.2rem;
    }
}

.hidden-field {
    display: none;
}