/**
 * Page Contact - Thibierge Notaires
 * Styles spécifiques à la page contact
 * Specs Figma: 1920px viewport
 */

/* =============================================
   PAGE CONTACT - LAYOUT
============================================= */

.page-contact {
    position: relative;
    background-color: var(--color-bg-white);
}

/* =============================================
   HERO SECTION
============================================= */

.contact-hero {
    position: relative;
    padding-top: 80px;
    padding-bottom: 64px;
}

/* Background gradient - Figma: top:-53px, left:-7px, 1767x1117 */
.contact-hero__bg {
    position: absolute;
    top: -53px;
    left: -7px;
    width: 1767px;
    height: 1117px;
    transform: rotate(180deg) scaleY(-1);
    pointer-events: none;
    z-index: 0;
}

/* Shape décorative - Figma: top:49px, left:-1010px, 3467x2224 */
.contact-hero__shape {
    position: absolute;
    top: -200px;
    left: -1010px;
    width: 3467px;
    height: 2224px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.contact-hero__shape img,
.contact-hero__shape svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Contenu hero — aligné avec la photo du form (même padding que .contact-form-section) */
.contact-hero__content {
    position: relative;
    z-index: 1;
    max-width: calc(1588px + var(--gutter-desktop) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter-desktop);
}

/* Titre - Figma: left calc(41.67%-647px) = aligne à ~153px sur 1920 */
.contact-hero__title {
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-size: 81.37px;
    line-height: 90px;
    color: var(--color-text-dark);
    margin-bottom: 24px;
    max-width: 1273px;
}

/* Sous-titre - Figma: width 458px */
.contact-hero__subtitle {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: var(--color-text-body);
    max-width: 458px;
}

/* =============================================
   FORM SECTION
============================================= */

.contact-form-section {
    position: relative;
    z-index: 2;
    padding: 0 var(--gutter-desktop);
}

/* Image de fond - Figma: centered, 1588x882 */
.contact-form-section__image {
    position: relative;
    width: 100%;
    max-width: 1588px;
    height: 882px;
    margin: 0 auto;
    overflow: hidden;
}

.contact-form-section__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Form wrapper - centré horizontalement */
.contact-form-wrapper {
    position: absolute;
    top: 131px;
    left: 50%;
    transform: translateX(-50%);
    width: 1118px;
    max-width: calc(100% - 120px);
    background-color: var(--color-bg-white);
    z-index: 3;
}

/* Barre d'accent - Figma: bleu 851px + jaune 267px = 1118px total, height 11px */
.contact-form-wrapper__accent-bar {
    display: flex;
    width: 100%;
    height: 11px;
}

.contact-form-wrapper__accent-primary {
    flex: 1;
    background-color: var(--color-primary);
}

.contact-form-wrapper__accent-secondary {
    width: 267px;
    flex-shrink: 0;
    background-color: var(--color-accent);
}

/* =============================================
   FORM MESSAGES
============================================= */

.contact-form__message {
    padding: var(--space-4) var(--space-6);
    margin: 0;
    font-family: var(--font-magnetik);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.5;
}

.contact-form__message--success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.contact-form__message--error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

/* =============================================
   FORM FIELD ERRORS
============================================= */

.contact-form__field--error .contact-form__input,
.contact-form__field--error .contact-form__textarea {
    border-color: #c62828;
}

.contact-form__error {
    display: block;
    font-family: var(--font-magnetik);
    font-weight: 400;
    font-size: 12px;
    color: #c62828;
    margin-top: 4px;
}

.contact-form__consent--error .contact-form__checkbox-custom {
    border-color: #c62828;
}

/* =============================================
   CONTACT FORM
============================================= */

.contact-form {
    padding: 48px 64px;
}

/* Figma: 2 colonnes, gap 64px, chaque colonne 432px */
.contact-form__grid {
    display: grid;
    grid-template-columns: 432px 432px;
    gap: 64px;
    justify-content: space-between;
}

.contact-form__column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-form__field {
    display: flex;
    flex-direction: column;
}

/* Labels - Magnetik Medium 15px, line-height 28px */
.contact-form__label {
    font-family: var(--font-magnetik);
    font-weight: 500;
    font-size: 15px;
    line-height: 28px;
    color: var(--color-text-dark);
    margin-bottom: 2px;
}

/* Inputs - Figma: height 50px, border #d8d8d8 */
.contact-form__input,
.contact-form__textarea {
    width: 100%;
    height: 50px;
    padding: 16px;
    font-family: var(--font-inter);
    font-size: 15px;
    color: var(--color-text-dark);
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    transition: border-color var(--transition-fast);
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
    color: var(--color-text-light);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Textarea - Figma: height 239px */
.contact-form__textarea {
    height: 239px;
    resize: vertical;
}

/* Footer form - Figma: line at top, margin-top 40px */
.contact-form__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

/* =============================================
   CHECKBOX
============================================= */

.contact-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 540px;
}

/* Checkbox - Figma: 10x10px, border #72777b */
.contact-form__checkbox {
    position: relative;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    margin-top: 4px;
}

.contact-form__checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.contact-form__checkbox-custom {
    position: absolute;
    inset: 0;
    border: 1px solid var(--color-border-dark);
    background-color: var(--color-bg-white);
    pointer-events: none;
}

.contact-form__checkbox input:checked + .contact-form__checkbox-custom {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.contact-form__checkbox input:checked + .contact-form__checkbox-custom::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 0;
    width: 4px;
    height: 7px;
    border: solid var(--color-bg-white);
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}

.contact-form__checkbox input:focus + .contact-form__checkbox-custom {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Consent text - Figma: Magnetik Light 12px, line-height 18px, width 527px */
.contact-form__consent-text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 12px;
    line-height: 18px;
    color: var(--color-text-body);
}

.contact-form__consent-text a {
    text-decoration: underline;
}

/* =============================================
   SUBMIT BUTTON
============================================= */

.contact-form__submit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

/* État loading pendant l'envoi : bloque les clics + feedback visuel */
.contact-form__submit--loading {
    opacity: 0.6;
    cursor: progress;
    pointer-events: none;
}

.contact-form__submit-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 1px;
}

/* Figma: Magnetik Light 18px, color #1e1e1e */
.contact-form__submit-text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    color: #1e1e1e;
    white-space: nowrap;
}

.contact-form__submit-icon {
    width: 12px;
    height: 11px;
    transition: transform 0.3s ease;
}

.contact-form__submit:hover .contact-form__submit-icon {
    transform: translateX(4px);
}

.contact-form__submit-line {
    width: 100%;
    height: 1px;
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.contact-form__submit-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-text-dark);
}

.contact-form__submit:hover .contact-form__submit-line::before {
    animation: lineWipe 0.5s ease;
}

@keyframes lineWipe {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(100%);
    }
    50.1% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* =============================================
   INFO SECTION (Map + Contact Info)
   Figma: aligné avec la photo 1588px
   Map: 946px, Info: 584px, Gap: 58px
============================================= */

/* Layout en grid avec ratio 946:584 conservé à toutes les tailles d'écran
   → la carte et le bloc bleu s'alignent toujours aux mêmes bords
   que la photo du form au-dessus (max-width 1588 + padding desktop). */
.contact-info-section {
    position: relative;
    display: grid;
    grid-template-columns: 946fr 584fr;
    gap: 58px;
    max-width: calc(1588px + var(--gutter-desktop) * 2);
    margin: 64px auto 0;
    padding: 0 var(--gutter-desktop);
}

/* Map - Figma: width 946px, height 678px */
.contact-map {
    width: 100%;
    height: 678px;
    background-color: #e5e3df;
}

/* Masquer l'attribution Mapbox */
.contact-map .mapboxgl-ctrl-logo,
.contact-map .mapboxgl-ctrl-attrib {
    display: none !important;
}

.contact-map iframe,
.contact-map__link,
.contact-map__image {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

/* Marqueur personnalisé */
.contact-map__marker {
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-map__marker:hover {
    transform: scale(1.05);
}

.contact-map__marker-label {
    background-color: var(--color-primary);
    color: #fff;
    font-family: var(--font-geometos);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    margin-bottom: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.contact-map__marker-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--color-primary);
}

/* Popup */
.contact-map__popup .mapboxgl-popup-content {
    padding: 16px 20px;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: var(--font-magnetik);
}

.contact-map__popup .mapboxgl-popup-close-button {
    font-size: 18px;
    padding: 4px 8px;
    color: var(--color-text-body);
}

.contact-map__popup-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-dark);
}

.contact-map__popup-content strong {
    font-weight: 600;
    color: var(--color-primary);
    display: block;
    margin-bottom: 4px;
}

.contact-map__popup-phone {
    color: var(--color-text-body);
    display: inline-block;
    margin-top: 4px;
}

.contact-map__popup-content a {
    display: inline-block;
    margin-top: 8px;
    color: #0199A4;
    font-weight: 500;
}

.contact-map__popup-content a:hover {
    text-decoration: underline;
}

/* Contact Info - Figma: width 584px, height 678px */
.contact-info {
    width: 100%;
    min-height: 678px;
    background-image: url('../../shapes/Rectangle 45753.png');
    background-size: cover;
    background-position: center;
    padding: 54px 44px 54px 121px;
    color: var(--color-text-white);
}

.contact-info__item {
    margin-bottom: 24px;
}

.contact-info__item:last-child {
    margin-bottom: 0;
}

/* Labels - Figma: Geometos Neue Light 14px, letter-spacing 1.4px */
.contact-info__label {
    font-family: var(--font-geometos);
    font-weight: 300;
    font-size: 14px;
    line-height: 30px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--color-text-white);
    margin-bottom: 0;
}

/* Values - Figma: Magnetik Light 18px, line-height 30px */
.contact-info__value {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: var(--color-text-white);
}

.contact-info__value p {
    margin-bottom: 0;
}

.contact-info__value a {
    color: var(--color-text-white);
}

.contact-info__value a:hover {
    text-decoration: underline;
}

/* =============================================
   RESPONSIVE - DESKTOP LARGE (1440px)
============================================= */

@media (max-width: 1700px) {
    .contact-hero__content,
    .contact-form-section,
    .contact-info-section {
        max-width: 100%;
    }

    .contact-form-wrapper {
        width: calc(100% - 120px);
        max-width: 1118px;
    }

    .contact-form__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Carte / info conservent leur ratio 946:584 via grid-template-columns ci-dessus
       → plus besoin de flex-basis fixe qui cassait l'alignement. */
    .contact-info {
        padding: 54px 40px 54px 60px;
    }
}

/* =============================================
   RESPONSIVE - TABLET (1024px)
============================================= */

@media (max-width: 1279px) {
    .contact-hero {
        padding-top: 48px;
        padding-bottom: 40px;
    }

    .contact-hero__content {
        padding: 0 40px;
    }

    .contact-hero__title {
        font-size: 60px;
        line-height: 70px;
    }

    .contact-form-wrapper {
        width: calc(100% - 80px);
    }

    .contact-form {
        padding: 32px;
    }

    .contact-form__grid {
        gap: 32px;
    }

    .contact-info-section {
        grid-template-columns: 1fr;
        padding: 0 var(--gutter-tablet);
        gap: 0;
    }

    .contact-map {
        width: 100%;
        max-width: none;
        height: 500px;
    }

    .contact-info {
        width: 100%;
        min-height: auto;
        padding: 40px;
    }
}

@media (max-width: 1023px) {
    .contact-hero__content {
        padding: 0 var(--gutter-tablet);
    }

    .contact-hero__title {
        font-size: 48px;
        line-height: 56px;
    }

    .contact-hero__subtitle {
        max-width: 100%;
    }

    .contact-form-section__image {
        height: auto;
        aspect-ratio: 16/10;
    }

    .contact-form-wrapper {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        width: calc(100% - 80px);
        max-width: none;
        margin: -100px auto 48px;
    }

    .contact-form__grid {
        grid-template-columns: 1fr;
    }

    .contact-form__footer {
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .contact-form__submit {
        align-self: flex-end;
    }

    .contact-info-section {
        padding: 0 var(--gutter-tablet);
    }
}

/* =============================================
   RESPONSIVE - MOBILE (768px)
============================================= */

@media (max-width: 767px) {
    .contact-hero__content {
        padding: 0 var(--gutter-mobile);
    }

    .contact-hero__title {
        font-size: 36px;
        line-height: 44px;
    }

    .contact-hero__subtitle {
        font-size: 16px;
        line-height: 26px;
    }

    .contact-form-section {
        padding: 0 var(--gutter-mobile);
    }

    .contact-form-wrapper {
        width: 100%;
        max-width: 100%;
        margin-top: -60px;
    }

    .contact-form {
        padding: 24px;
    }

    .contact-form__grid {
        gap: 16px;
    }

    .contact-info-section {
        padding: 0 var(--gutter-mobile);
        margin-top: 40px;
    }

    .contact-map {
        height: 350px;
    }

    .contact-info {
        padding: 32px 24px;
    }
}

/* =============================================
   RESPONSIVE - SMALL MOBILE (375px)
============================================= */

@media (max-width: 374px) {
    .contact-hero__title {
        font-size: 30px;
        line-height: 38px;
    }

    .contact-form-wrapper {
        width: calc(100% - 30px);
    }

    .contact-form {
        padding: 16px;
    }

    .contact-info {
        padding: 24px 16px;
    }
}

/* =============================================
   SCREEN READER ONLY
============================================= */

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