/* ---- Icônes SVG ---- */
.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;        /* hérite de la couleur du texte */
    vertical-align: -0.125em;  /* alignement optique sur la baseline */
    flex-shrink: 0;
}

/* ==========================================================================
   LOADER
   ========================================================================== */
.loader,
.loader span {
    height: 32px;
    width: 32px;
}

.loader span {
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    margin: auto;
}

.loader span::before,
.loader span::after {
    content: "";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    margin: auto;
    height: 32px;
    width: 32px;
    border: 2px solid #FFF;
    border-radius: 50%;
    opacity: 0;
    animation: loader-1 1.5s cubic-bezier(0.075, 0.820, 0.165, 1.000) infinite;
}

/* ==========================================================================
   ARTICLE
   ========================================================================== */
article {
    width: 95%;
    margin: 1% 0;
    padding: 3px;
    background-color: var(--surface-raised);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    transition: background-color var(--transition-duration) ease,
                border var(--transition-duration) ease;
}

article[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Le hover « carte » ne concerne QUE les articles, jamais le formulaire */
article:hover {
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
}

article header {
    margin-top: 3px;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

article p {
    padding: 2%;
    margin-top: 3px;
    font-family: var(--font-family-main);
    font-weight: 400;
    text-align: justify;
    color: var(--text-color);
}

article a {
    color: var(--highlight-color);
    text-decoration: none;
}

article a i {
    font-size: 80%;
}

article a:hover {
    text-decoration: underline;
}

.titles {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: start;
}

.circleLevel .icon { width: 1em; height: 1em; color:#000000}

/* ==========================================================================
   CARTE DE VISITE
   ========================================================================== */
#photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-image: url("../img/me/me.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

#title {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

#welcomeMsg {
    margin-left: 0;
    width: 100%;
    color: #FFFFFF;
    font-weight: 300;
    letter-spacing: 7px;
    text-align: center;
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */
#welcomeBtn,
#submitBtn,
#prevBtn,
#nextBtn {
    padding: 5px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius);
    border: 0;
    cursor: pointer;
    transition: background-color 0.5s ease-in-out, transform 0.3s linear;
}

#welcomeBtn:hover,
#submitBtn:hover,
#prevBtn:hover,
#nextBtn:hover {
    background-color: var(--primary-hover);
}

#welcomeBtn .icon { transform: rotate(45deg); transition: transform 0.5s ease; color:#000000}
#welcomeBtn:hover .icon { transform: rotate(0deg); }
#prevBtn:hover .icon { transform: translateX(-5px); }
#nextBtn:hover .icon { transform: translateX(5px); }

#welcomeBtn {
    width: 50%;
    font-size: 150%;
}

#welcomeBtn:hover {
    transform: scale(1.1);
}

#prevBtn,
#nextBtn {
    width: 25%;
}

#prevBtn .icon,
#nextBtn .icon {
    color:#000000;
    transition: transform 0.3s linear;
}


/* `flex: 0 0 auto` empêche le conteneur flex d'écraser le bouton,
   `white-space: nowrap` garde le libellé et l'icône sur une ligne. */
#submitBtn {
    flex: 0 0 auto;
    width: auto;
    min-width: 220px;
    padding: 12px 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 105%;
}

#submitBtn:hover {
    transform: scale(1.03);
}

/* ==========================================================================
   BLOC TÉLÉPHONE
   ========================================================================== */
.phoneBlock {
    box-sizing: border-box;
    width: 95%;
    margin: 1% 0;
    padding: 20px;
    background-color: var(--surface-raised);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.phoneBlock header {
    margin-bottom: 16px;
}

.phoneBlock header h5 {
    font-size: 100%;
}

/* `display: flex` (et non inline-flex) pour que `margin: 0 auto` centre */
.phoneBtn {
    display: flex;
    width: fit-content;
    margin: 0 auto;
    padding: 12px 28px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-family-main);
    font-size: 110%;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.phoneBtn:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
    transform: scale(1.03);
    text-decoration: none;
}

.phoneBtn:hover .icon{
    color: #FFFFFF;
}

/* ==========================================================================
   FORMULAIRE DE CONTACT
   ========================================================================== */
.contactForm {
    box-sizing: border-box;
    width: 95%;
    margin: 1% 0;
    padding: 20px;
    background-color: var(--surface-raised);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    font-family: var(--font-family-main);
    font-weight: 400;
    color: #FFFFFF;
}

.contactForm *,
.contactForm *::before,
.contactForm *::after {
    box-sizing: border-box;
}

.contactForm header {
    margin: 0 0 16px;
    padding: 0;
    display: block;
    height: auto;
}

.contactForm header h5 {
    font-size: 100%;
}

.formGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
}

.formField {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formField.fullWidth {
    grid-column: 1 / -1;
}

.contactForm label {
    font-size: 75%;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.contactForm input,
.contactForm textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-family-main);
    font-size: 95%;
    color: #FFFFFF;
    background-color: var(--surface-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contactForm input:focus,
.contactForm textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 92, 0, 0.25);
}

.contactForm textarea {
    min-height: 130px;
    resize: vertical;
}

.formActions {
    grid-column: 1 / -1;
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.submitBtn .icon{
    color:#000000;
}

/* ==========================================================================
   ZONE DE DÉPÔT DE FICHIERS
   ========================================================================== */
.dropzone {
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    background-color: var(--surface-input);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--primary-color);
    background-color: var(--surface-input-hover);
    outline: none;
}

.dropzone.isDragging {
    border-color: var(--primary-color);
    background-color: rgba(255, 92, 0, 0.08);
}

.dropzoneIcon {
    font-size: 200%;
    color: var(--primary-color);
}

.dropzoneText {
    margin: 0;
    font-size: 90%;
    color: var(--text-color);
}

.dropzoneText strong {
    color: var(--primary-color);
}

.dropzoneHint {
    margin: 0;
    font-size: 72%;
    font-style: italic;
    color: var(--text-faint);
}

/* ---- Liste des fichiers sélectionnés ---- */
.fileList {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.fileList li {
    margin-bottom: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 85%;
    background-color: var(--surface-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.fileList li.isInvalid {
    border-color: var(--error-color);
    color: var(--error-color);
}

.fileList .fileName {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fileList .fileSize {
    color: var(--text-faint);
    font-size: 90%;
}

.fileList .fileRemove {
    padding: 2px 6px;
    color: var(--text-faint);
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.fileList .fileRemove:hover {
    color: var(--error-color);
}

/* ==========================================================================
   MESSAGE DE CONFIRMATION / ERREUR
   ========================================================================== */
.formFlash {
    box-sizing: border-box;
    width: 95%;
    margin: 1% 0;
    padding: 10px;
    border-radius: var(--border-radius);
    font-family: var(--font-family-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.formFlash i {
    font-size: 200%;
    margin-bottom: 6px;
}

.formFlash p {
    margin: 2px 0;
}

.formFlash--success {
    background: rgba(46, 160, 67, 0.15);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.formFlash--error {
    background: rgba(233, 56, 63, 0.15);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* ==========================================================================
   TOOLTIP
   ========================================================================== */
.tooltip {
    position: fixed;
    z-index: 1000;
    max-width: 260px;
    padding: 8px 12px;
    background: var(--secondary-color);
    color: #FFFFFF;
    font-family: var(--font-family-main);
    font-size: 85%;
    line-height: 1.4;
    text-align: center;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    pointer-events: none;          /* sinon la bulle vole le survol à la tuile */
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip.isVisible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip.isBelow { transform: translateY(-4px); }
.tooltip.isBelow.isVisible { transform: translateY(0); }

/* Flèche, recentrée sur la cible via --arrow-x */
.tooltip::after {
    content: '';
    position: absolute;
    left: var(--arrow-x, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
}

.tooltip:not(.isBelow)::after {
    top: 100%;
    border-top-color: var(--secondary-color);
}

.tooltip.isBelow::after {
    bottom: 100%;
    border-bottom-color: var(--secondary-color);
}

.tile[data-tooltip] { cursor: help; }

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    #welcomeBtn {
        width: 90%;
    }

    #submitBtn {
        width: 100%;
        min-width: 0;
    }

    .formGrid {
        grid-template-columns: 1fr;
    }

    .contactForm {
        padding: 15px 10px;
    }

    .phoneBlock {
        padding: 15px 10px;
    }

    .phoneBtn {
        width: 100%;
    }
}