/* ============================== */
/* STYLES PAGE CONTACT */
/* ============================== */

:root {
    --primary-color: #D2B48C;
    --secondary-color: #8B4513;
    --text-dark: #2c3e50;
    --text-light: #666;
    --white: #ffffff;
    --beige: #F5F2E8;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-color: rgba(210, 180, 140, 0.3);
    --transition: all 0.3s ease;
    --error-color: #e74c3c;
    --success-color: #4CAF50;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--beige);
    color: var(--text-dark);
    line-height: 1.6;
    padding-top: 90px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================== */
/* CONTAINER PRINCIPAL */
/* ============================== */

.page-wrapper {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================== */
/* EN-TÊTE DE LA PAGE */
/* ============================== */

.contact-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease-out;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.8rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    position: relative;
    display: block;
    text-align: center;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 20px;
    line-height: 1.6;
}

/* ============================== */
/* CARTE FORMULAIRE */
/* ============================== */

.contact-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow);
    padding: 45px;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ============================== */
/* FORMULAIRE */
/* ============================== */

form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Labels */
label {
    font-size: 0.95rem;
    color: var(--secondary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Champs de saisie */
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    color: var(--text-dark);
    transition: var(--transition);
    font-family: inherit;
    background-color: var(--white);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: var(--primary-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* Textarea spécifique */
textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* ============================== */
/* SELECT PERSONNALISÉ */
/* ============================== */

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 45px;
    cursor: pointer;
}

/* ============================== */
/* TELEPHONE AVEC DRAPEAU */
/* ============================== */

.phone-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 18px;
    transition: var(--transition);
    background-color: var(--white);
}

.phone-wrapper:hover {
    border-color: var(--primary-color);
}

.phone-wrapper:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.phone-flag {
    width: 32px;
    height: 22px;
    background: url('https://flagcdn.com/fr.svg') no-repeat center/contain;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.phone-code {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
    user-select: none;
    padding-right: 12px;
    border-right: 2px solid var(--border-color);
    flex-shrink: 0;
}

.phone-wrapper input[type="text"] {
    border: none;
    padding: 0;
    flex: 1;
    outline: none;
    background: transparent;
    font-weight: 500;
}

.phone-wrapper input[type="text"]:focus,
.phone-wrapper input[type="text"]:hover {
    border: none;
    box-shadow: none;
}

/* ============================== */
/* BOUTON */
/* ============================== */

.button-contact {
    margin-top: 10px;
    padding: 16px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
    font-family: 'Playfair Display', serif;
}

.button-contact:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.button-contact:active {
    transform: translateY(-1px);
}

/* ============================== */
/* TEXTE PETIT */
/* ============================== */

.small-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 25px;
    font-style: italic;
    opacity: 0.8;
}

/* ============================== */
/* TOAST NOTIFICATIONS */
/* ============================== */

.toast {
    visibility: hidden;
    min-width: 300px;
    background-color: var(--success-color);
    color: var(--white);
    text-align: center;
    border-radius: 50px;
    padding: 18px 30px;
    position: fixed;
    z-index: 9999;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.5s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    top: 100px;
}

.toast.error {
    background-color: var(--error-color);
}

/* ============================== */
/* ANIMATIONS */
/* ============================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================== */
/* ÉTATS DE VALIDATION */
/* ============================== */

input:invalid:not(:focus):not(:placeholder-shown),
textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--error-color);
}

input:valid:not(:focus):not(:placeholder-shown):not([type="text"]),
textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: var(--success-color);
}

/* Amélioration du contraste pour les placeholders */
input::placeholder,
textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* ============================== */
/* RESPONSIVE DESIGN */
/* ============================== */

@media (max-width: 992px) {
    body {
        padding-top: 80px;
    }

    .page-wrapper {
        padding: 35px 20px;
    }

    h2 {
        font-size: 2.3rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .page-wrapper {
        padding: 30px 15px;
    }

    .contact-card {
        padding: 35px 25px;
    }

    h2 {
        font-size: 2rem;
    }

    p.subtitle {
        font-size: 1rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    .phone-wrapper {
        padding: 12px 16px;
    }

    .button-contact {
        padding: 14px 0;
        font-size: 1rem;
    }

    .toast {
        min-width: 280px;
        top: 70px;
    }

    .toast.show {
        top: 90px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }

    .page-wrapper {
        padding: 25px 10px;
    }

    .contact-card {
        padding: 30px 20px;
    }

    h2 {
        font-size: 1.7rem;
    }

    h2::after {
        width: 60px;
    }

    p.subtitle {
        font-size: 0.9rem;
        margin-top: 15px;
    }

    form {
        gap: 20px;
    }

    .form-group {
        gap: 6px;
    }

    label {
        font-size: 0.9rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    .phone-wrapper {
        padding: 12px 14px;
    }

    .phone-flag {
        width: 28px;
        height: 20px;
    }

    .phone-code {
        font-size: 0.9rem;
        padding-right: 10px;
    }

    .button-contact {
        padding: 13px 0;
        font-size: 0.95rem;
    }

    .small-text {
        font-size: 0.8rem;
        margin-top: 20px;
    }

    .toast {
        min-width: 250px;
        font-size: 0.9rem;
        padding: 15px 25px;
        top: 60px;
    }

    .toast.show {
        top: 80px;
    }
}

/* ============================== */
/* ACCESSIBILITÉ */
/* ============================== */

input:focus,
select:focus,
textarea:focus,
.button-contact:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================== */
/* CORRECTIONS SPÉCIFIQUES */
/* ============================== */

/* S'assurer que le contenu est scrollable */
.page-wrapper {
    overflow-y: auto;
}

/* Éviter les conflits avec le header/footer */
header,
footer {
    flex-shrink: 0;
}

/* Assurer la visibilité du titre */
h2 {
    z-index: 1;
    position: relative;
}