/* ------------------------------ Animations ------------------------------ */

@keyframes logoFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(6px, -10px) rotate(10deg); }
    50% { transform: translate(-6px, -20px) rotate(20deg); }
    75% { transform: translate(-4px, 8px) rotate(10deg); }
}

@keyframes pageTransition {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------ Base ------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #07111f;
    --card: #101c2e;
    --text: #ffffff;
    --muted: #9aa8bd;
    --primary: #f97316;
    --border: rgba(255, 255, 255, .08);
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, .35) 0%, transparent 35%),
        radial-gradient(circle at top left, #1e293b 10%, transparent 45%),
        radial-gradient(circle at bottom right, #7c2d12 0%, transparent 35%),
        var(--bg);
}

section {
    width: min(1200px, 92%);
    margin: 90px auto;
}

.section-title {
    margin-bottom: 60px;
    text-align: center;
}

.section-title h2 {
    margin-top: 12px;
    font-size: 2.5rem;
}

.section-title h3 {
    color: var(--primary);
    font-size: .9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ------------------------------ Header ------------------------------ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 8%;
    background: rgba(7, 17, 31, .75);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 50px 50px;
    backdrop-filter: blur(15px);
}

.logo img {
    width: 100px;
    border-radius: 50%;
    background: white;
    animation: logoFloat 6s ease-in-out infinite;
}

nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

nav a,
.footer-grid a {
    color: white;
    text-decoration: none;
    transition: .3s;
}

nav a:hover,
.footer-grid a:hover,
.back-link:hover {
    color: var(--primary);
}

nav a,
.btn-primary,
.btn-secondary,
button,
label {
    font-weight: 600;
}

.nav-btn,
.btn-primary,
.btn-secondary,
button,
input,
textarea {
    border-radius: 16px;
}

.nav-btn {
    padding: 12px 20px;
    background: var(--primary);
}

/* ------------------------------ Presentation ------------------------------ */

.presentation {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 90px;
    margin-bottom: auto;
    padding: 40px 20px;
    text-align: center;
}

.presentation-content,
.presentation h1 {
    width: 100%;
}

.presentation h1 {
    margin-bottom: 25px;
    font-size: clamp(2.2rem, 5vw, 5rem);
    line-height: 1.1;
    white-space: nowrap;
}

.presentation h1 span,
.about-card h3,
.service-card i,
.step-number,
.back-link {
    color: var(--primary);
}

.presentation h1 span {
    display: block;
}

.presentation p {
    max-width: 700px;
    margin: auto;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.8;
}

.presentation-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.btn-primary,
.btn-secondary,
button {
    padding: 16px 28px;
    transition: .35s;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    color: white;
    background: var(--primary);
    box-shadow: 0 10px 35px rgba(249, 115, 22, .35);
}

.btn-secondary {
    color: white;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .15);
}

.btn-primary:hover,
.btn-secondary:hover,
button:hover {
    transform: translateY(-4px);
}

/* ------------------------------ Cards & Grids ------------------------------ */

.about,
.services-grid,
.steps-grid {
    display: grid;
    gap: 30px;
}

.about {
    grid-template-columns: repeat(3, 1fr);
    margin: 50px;
}

.services-grid,
.steps-grid {
    grid-template-columns: repeat(3, 1fr);
}

.steps-grid {
    align-items: stretch;
}

.about-card,
.service-card,
.step-card,
.contact-card {
    background: rgba(16, 28, 46, .75);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-card,
.service-card,
.step-card {
    padding: 35px;
    border-radius: 24px;
    transition: .4s;
}

.about-card:hover,
.service-card:hover,
.step-card:hover {
    transform: translateY(-16px) rotate(3deg);
    border-color: rgba(249, 115, 22, .45);
}

.about-card {
    text-align: center;
}

.about-card h3 {
    margin-bottom: 10px;
    font-size: 2rem;
}

.service-card i {
    display: block;
    margin: 0 auto 20px;
    font-size: 50px;
}

.service-card h3,
.step-card h3 {
    margin-bottom: 15px;
}

.service-card p,
.step-card p,
.contact-card p,
.footer-grid p,
.footer-grid a {
    color: var(--muted);
    line-height: 1.7;
}

.step-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    font-weight: 700;
    background: var(--primary);
    border-radius: 50%;
    color: white;
}

#step-card-empty1, #step-card-empty2{
    background-color: transparent;
    border: none;
}
/* ------------------------------ Fonctionnement ------------------------------ */

#fonctionnement {
    margin: 0 auto 90px;
}

/* ------------------------------ CTA ------------------------------ */

.cta-section {
    padding: 80px 30px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #f97416c7, #8d3607);
    border-radius: 50px;
    box-shadow: 0 15px 40px rgba(234, 88, 12, .25);
}

.cta-section h2 {
    margin-bottom: 20px;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
}

.cta-section p {
    margin-bottom: 35px;
    color: rgba(255, 255, 255, .9);
    font-size: 1.1rem;
    line-height: 1.6;
}

.cta-section .btn-primary {
    display: inline-block;
    color: #ea580c;
    background: white;
}

.cta-section .btn-primary:hover {
    background: #fff7ed;
}

/* ------------------------------ Footer ------------------------------ */

footer {
    margin-top: 100px;
    padding: 70px 8% 30px;
    background: #030712;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: space-evenly;
    gap: 40px;
    text-align: center;
}

.footer-grid h4,
.footer-grid h3 {
    margin-bottom: 18px;
}

.footer-grid a,
.footer-grid p {
    display: block;
    margin-bottom: 10px;
}

.footer-bottom {
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ------------------------------ Contact ------------------------------ */

.contact-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    animation: pageTransition .45s ease-out;
}

.contact-card {
    width: 100%;
    max-width: 650px;
    padding: 50px;
    border-radius: 32px;
}

.contact-card h1 {
    margin-bottom: 20px;
    font-size: 3rem;
}

.contact-card p {
    margin-bottom: 30px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input,
textarea {
    width: 100%;
    padding: 18px;
    border: none;
    color: white;
    background: rgba(255, 255, 255, .05);
    font-family: inherit;
}

textarea {
    min-height: 180px;
    resize: vertical;
}

button {
    border: none;
    color: white;
    background: var(--primary);
}

label {
    margin-bottom: -10px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    text-decoration: none;
}

#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: orange;
  color: white;
  border-radius: 50%;
  padding: 15px;
  font-size: 18px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: 0.3s;
}

#backToTop:hover {
  background-color: #ff8c00;
  transform: scale(1.1);
}

html {
  scroll-behavior: smooth;
}

#backToTop {
  opacity: 0.8;
}

#backToTop:hover {
  opacity: 1;
}

/* ------------------------------ Responsive ------------------------------ */

/* =========================================================
   RESPONSIVE COMPLET
   TABLETTES + IPAD + SMARTPHONES
========================================================= */


/* =========================================================
   TABLETTES (iPad Pro, Surface, etc.)
========================================================= */
@media (max-width: 1024px) {

    /* Header plus compact */
    header {
        padding: 12px 4%;
        border-radius: 0 0 25px 25px;
        min-height: auto;
    }

    /* Suppression animations logo */
    .logo,
    .logo img {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }

    .logo:hover,
    .logo img:hover {
        transform: none !important;
    }

    .logo img {
        width: 65px;
    }

    nav {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 0.95rem;
    }

    .nav-btn {
        padding: 10px 16px;
    }

    section {
        width: 92%;
    }

    .presentation h1 {
        white-space: normal;
    }

    .about,
    .services-grid,
    .steps-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
        justify-content: center;
    }

    .about-card,
    .service-card,
    .step-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .contact-card {
        max-width: 90%;
        margin: auto;
    }

    .section-title h2 {
        font-size: 2rem;
    }
}


/* =========================================================
   SMARTPHONES & PETITES TABLETTES
========================================================= */
@media (max-width: 768px) {

    section {
        width: 94%;
        margin: 60px auto;
    }


    
    /* Header */
    header {
        flex-direction: column;
        align-items: center;
        padding: 10px 12px;
        gap: 10px;
        border-radius: 0 0 20px 20px;
    }

    .logo img {
        width: 50px;
    }

    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    nav a {
        font-size: 0.9rem;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    /* Hero */
    .presentation {
        min-height: auto;
        margin-top: 30px;
        padding: 30px 15px;
    }

    .presentation h1 {
        font-size: clamp(2rem, 9vw, 3rem);
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .presentation p {
        font-size: 1rem;
        text-align: center;
    }

    .presentation-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 320px;
        text-align: center;
    }

    /* Grilles */
    .about,
    .services-grid,
    .steps-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    /* Cartes centrées */
    .about-card,
    .service-card,
    .step-card {
        width: 100%;
        max-width: 500px;
        margin: auto;
        text-align: center;
    }

    /* Cartes vides */
    #step-card-empty1,
    #step-card-empty2 {
        display: none;
    }

    .section-title {
        text-align: center;
    }

    .section-title h2 {
        font-size: 1.9rem;
    }

    /* CTA */
    .cta-section {
        padding: 50px 20px;
        border-radius: 25px;
        text-align: center;
    }

    .cta-section h2 {
        font-size: 2rem;
    }

    /* Contact */
    .contact-card {
        width: 100%;
        padding: 30px 20px;
        text-align: center;
    }

    .contact-card h1 {
        font-size: 2rem;
    }

    /* Footer */
    .footer-grid {
        text-align: center;
        gap: 25px;
    }

    #backToTop {
        right: 15px;
        bottom: 15px;
        padding: 12px;
    }
}


/* =========================================================
   PETITS SMARTPHONES (iPhone SE, Galaxy A, etc.)
========================================================= */
@media (max-width: 480px) {

    header {
        padding: 8px 10px;
        gap: 8px;
    }

    .logo img {
        width: 42px;
    }

    nav {
        gap: 6px;
        flex-direction: column;
    }

    nav a {
        font-size: 0.85rem;
    }

    .nav-btn {
        padding: 7px 12px;
        font-size: 0.85rem;
    }

    
    .about{
        margin: 0;
    }
    .presentation-buttons{
        margin-bottom: 40px;
    }

    .presentation h1 {
        font-size: 1.9rem;
    }

    .presentation p {
        font-size: 0.95rem;
    }

    .section-title h2 {
        font-size: 1.7rem;
    }

    .about-card,
    .service-card,
    .step-card {
        padding: 25px;
    }

    .contact-card {
        padding: 25px 15px;
    }

    .contact-card h1 {
        font-size: 1.7rem;
    }

    .cta-section {
        padding: 40px 15px;
    }

    .cta-section h2 {
        font-size: 1.7rem;
    }

    input,
    textarea,
    button {
        font-size: 16px;
    }
}


/* =========================================================
   TRÈS PETITS ÉCRANS (< 360px)
========================================================= */
@media (max-width: 360px) {

    .logo img {
        width: 38px;
    }

    .presentation h1 {
        font-size: 1.6rem;
    }

    .presentation-buttons{
        margin-bottom: 40px;
    }
    .section-title h2,
    .cta-section h2,
    .contact-card h1 {
        font-size: 1.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 18px;
    }

    nav {
        flex-direction: column;
        gap: 6px;
    }
}

/* Modal corrigée */
.contact-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    z-index: 9999;
}

.contact-modal.active {
    opacity: 1;
    visibility: visible;
}

.contact-modal-content {
    position: relative;
    width: min(90%, 450px);
    padding: 40px 35px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
