@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&display=swap');

@font-face {
    font-family: 'Ragamgaris';
    src: url('/font/ragamgaris-font/RagamgarisDemo-5yBZ8.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

.font-ragamgaris {
    font-family: 'Ragamgaris', sans-serif;
    letter-spacing: 0.05em;
}

.dots {
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
    animation: wave 12s linear infinite;
}

@keyframes wave {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 40px 20px;
    }

    100% {
        background-position: 0 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.menu-enter {
    animation: slideDown 0.3s ease-out forwards;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 28px;
    height: 30px;
    cursor: pointer;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

:root {
    --bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --card: #ffffff;
    --border: #e5e7eb;
    --accent-bg: #000000;
    --accent-text: #ffffff;
    --btn-bg: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
    --btn-text: #ffffff;
    --btn-border: rgba(0, 0, 0, 0.9);
    --btn-shadow: 0 8px 20px rgba(2, 6, 23, 0.15);
    --btn-shadow-hover: 0 14px 32px rgba(2, 6, 23, 0.22);
}

.dark {
    --bg: #071225;
    --text: #e6eef8;
    --muted: #b4bac4;
    --card: #071827;
    --border: #1f2937;
    --accent-bg: #111827;
    --accent-text: #ffffff;
    --btn-bg: linear-gradient(180deg, #111827 0%, #020617 100%);
    --btn-text: var(--accent-text);
    --btn-border: rgba(255, 255, 255, 0.06);
    --btn-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
    --btn-shadow-hover: 0 14px 32px rgba(2, 6, 23, 0.55);
}

.dark #site-header:not(.bg-transparent) {
    background-color: rgba(7, 18, 37, 0.9) !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.dark footer,
.dark .bg-gray-50 {
    background-color: #061420 !important;
}

/* Index page footer overrides – force white text always */
footer.footer-white,
footer.footer-white a,
footer.footer-white li,
footer.footer-white h4,
footer.footer-white p,
footer.footer-white span,
footer.footer-white div {
    color: #ffffff !important;
}

footer.footer-white a:hover {
    color: #f4793a !important;
}

html,
body {
    transition: background-color .25s ease, color .25s ease;
}

body {
    background-color: var(--bg);
    color: var(--text);
}

.bg-white {
    background-color: var(--card) !important
}

.text-gray-800,
.text-gray-900 {
    color: var(--text) !important
}

.text-gray-600,
.text-gray-700,
.text-gray-500 {
    color: var(--muted) !important
}

.border-gray-200 {
    border-color: var(--border) !important
}

.bg-black {
    background-color: var(--accent-bg) !important;
    color: var(--accent-text) !important
}

.hover\:bg-gray-800:hover {
    background-color: var(--accent-bg) !important;
    color: var(--accent-text) !important
}

label {
    color: var(--muted) !important;
}

.dark .text-gray-600,
.dark .text-gray-700,
.dark .text-gray-500 {
    color: var(--muted) !important;
}

.dark label,
.dark label.text-gray-600,
.dark label.text-gray-700 {
    color: var(--muted) !important;
}

.dark #devis label {
    color: var(--muted) !important;
}

.dark #devis .text-gray-600,
.dark #devis .text-gray-700,
.dark #devis .text-gray-800 {
    color: var(--muted) !important;
}

.devis-btn {
    position: relative;
    z-index: 10;
    background: var(--btn-bg);
    color: var(--btn-text) !important;
    padding: .45rem .9rem;
    border-radius: .6rem;
    box-shadow: var(--btn-shadow);
    border: 1px solid var(--btn-border);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.devis-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--btn-shadow-hover);
}

.devis-hero {
    padding: .75rem 1.25rem;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
}

/* scroll-behavior: smooth retiré — Lenis gère le smooth scroll */

#devis {
    scroll-margin-top: 120px;
}

@media (min-width: 768px) {
    #devis {
        scroll-margin-top: 140px;
    }
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.6);
}

.dark input[type="text"],
.dark input[type="email"],
.dark input[type="tel"],
.dark select,
.dark textarea {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    -webkit-text-fill-color: var(--text) !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}

.dark select option {
    background: var(--card) !important;
    color: var(--text) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0px 1000px var(--card) inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

input,
textarea,
select {
    color: var(--text) !important;
    background: var(--card) !important;
    border-color: var(--border) !important;
    opacity: 1 !important;
}

input,
textarea,
select,
input::placeholder,
textarea::placeholder {
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text) !important;
}

.dark .w-full.border.rounded-md.px-4.py-2,
.dark input.w-full.border.rounded-md.px-4.py-2,
.dark textarea.w-full.border.rounded-md.px-4.py-2,
.dark select.w-full.border.rounded-md.px-4.py-2 {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text) !important;
}

.dark .border-gray-300,
.dark .border-gray-300:focus {
    border-color: var(--border) !important;
    background: var(--card) !important;
    color: var(--text) !important;
}

#devis-form input,
#devis-form textarea,
#devis-form select {
    background: var(--card) !important;
    color: var(--text) !important;
    caret-color: var(--text) !important;
    border-color: var(--border) !important;
}

#devis-form input::placeholder,
#devis-form textarea::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}

html:not(.dark) #devis-form input::placeholder,
html:not(.dark) #devis-form textarea::placeholder {
    color: #9ca3af !important;
    font-weight: 400;
    font-style: italic;
    opacity: 0.5 !important;
}

html:not(.dark) #devis-form input::-webkit-input-placeholder,
html:not(.dark) #devis-form textarea::-webkit-input-placeholder {
    color: #9ca3af !important;
    font-weight: 400;
    font-style: italic;
    opacity: 0.5 !important;
}

html:not(.dark) #devis-form input::-moz-placeholder,
html:not(.dark) #devis-form textarea::-moz-placeholder {
    color: #9ca3af !important;
    font-weight: 400;
    font-style: italic;
    opacity: 0.5 !important;
}

html:not(.dark) #devis-form input:-ms-input-placeholder,
html:not(.dark) #devis-form textarea:-ms-input-placeholder {
    color: #d1d5db !important;
    font-weight: 400;
    font-style: normal;
    opacity: 1;
}

html:not(.dark) #devis-form select:required:invalid {
    color: #d1d5db !important;
}

html:not(.dark) #devis-form select:not(:placeholder-shown),
html:not(.dark) #devis-form select:valid {
    color: #111827 !important;
}

html:not(.dark) #devis-form select option[disabled] {
    color: #d1d5db !important;
}

:root #devis-form label {
    color: #111827 !important;
    font-weight: 600;
}

html:not(.dark) #devis-form input[type="text"],
html:not(.dark) #devis-form input[type="email"],
html:not(.dark) #devis-form input[type="tel"],
html:not(.dark) #devis-form select,
html:not(.dark) #devis-form textarea {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
    -webkit-text-fill-color: #111827 !important;
    font-weight: 500;
}

.dark #devis-form input,
.dark #devis-form textarea,
.dark #devis-form select {
    background: var(--card) !important;
    color: var(--text) !important;
    caret-color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
}

.dark #devis-form input::-webkit-input-placeholder,
.dark #devis-form textarea::-webkit-input-placeholder {
    color: var(--muted) !important;
    opacity: 1;
}

#devis-form select option {
    background: var(--card) !important;
    color: var(--text) !important;
}

#devis-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 1rem) calc(1em + 2px), calc(100% - .65rem) calc(1em + 2px);
    background-size: .45em .45em, .45em .45em;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}

.dark input,
.dark textarea,
.dark select,
.dark option,
.dark datalist {
    background: var(--card) !important;
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text) !important;
    border-color: var(--border) !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: var(--muted) !important;
    opacity: 1 !important;
}

.dark input:-webkit-autofill,
.dark input:-webkit-autofill:focus,
.dark input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0px 1000px var(--card) inset !important;
    -webkit-text-fill-color: var(--text) !important;
}

.dark [id^="modal-"]>div:not(.absolute) {
    background: rgba(7, 24, 39, 0.85) !important;
    color: var(--text) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.dark [id^="modal-"] .sticky.top-0 {
    background: rgba(7, 24, 39, 0.80) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark [id^="modal-"] .bg-white {
    background: var(--card) !important;
}

.dark [id^="modal-"] .bg-gray-50 {
    background: rgba(255, 255, 255, 0.03) !important;
}

.dark [id^="modal-"] .bg-blue-50 {
    background: rgba(30, 64, 175, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[id^="modal-"] .bg-blue-50 {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), 0 0 40px rgba(34, 197, 94, 0.15), inset 0 0 15px rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

.dark [id^="modal-"] .bg-blue-50 {
    background: rgba(30, 64, 175, 0.15) !important;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.4), 0 0 50px rgba(34, 197, 94, 0.2), inset 0 0 20px rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.5) !important;
}

.dark [id^="modal-"] .border-gray-200 {
    border-color: var(--border) !important;
}

.dark [id^="modal-"] h3,
.dark [id^="modal-"] h4 {
    color: var(--text) !important;
}

.dark [id^="modal-"] .text-gray-700,
.dark [id^="modal-"] .text-gray-600 {
    color: var(--muted) !important;
}

.dark [id^="modal-"] .text-gray-800 {
    color: var(--text) !important;
}

.dark [id^="modal-"] p,
.dark [id^="modal-"] li,
.dark [id^="modal-"] ul {
    color: var(--muted) !important;
}

.dark [id^="modal-"] strong {
    color: var(--text) !important;
    font-weight: 700;
}

[id^="modal-"]>div:not(.absolute) {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dark [id^="modal-"]>div:not(.absolute) {
    scrollbar-color: var(--border) transparent;
}

[id^="modal-"]>div:not(.absolute)::-webkit-scrollbar {
    width: 8px;
}

[id^="modal-"]>div:not(.absolute)::-webkit-scrollbar-track {
    background: transparent;
}

[id^="modal-"]>div:not(.absolute)::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark [id^="modal-"]>div:not(.absolute)::-webkit-scrollbar-thumb {
    background: var(--border);
}

.modal-form input,
.modal-form textarea,
.modal-form select {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.modal-form label {
    color: var(--muted) !important;
}

.dark .modal-form input,
.dark .modal-form textarea,
.dark .modal-form select {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    -webkit-text-fill-color: var(--text) !important;
}

/* 3D Animations & Carousel */
.hero-title-container {
    width: 100%;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(-50px);
    margin-top: -20vh;
    display: flex;
    justify-content: center;
}

.hero-title-main {
    font-family: 'Alfa Slab One', cursive;
    font-size: clamp(2rem, 11vw, 25rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    margin: 0;
    padding: 0 3vw;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 100vw;
}

.hero-letter {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), font-size 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: top center;
}

.carousel-scene {
    width: 100%;
    height: 40vh;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -10vh;
    z-index: 5;
    transform-style: preserve-3d;
}

.carousel-tilt {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateZ(-18deg) rotateX(-8deg);
    margin-top: 13vh;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-container {
    width: 300px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    /* Animation gérée par JS pour permettre le contrôle à la souris */
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.carousel-container * {
    -webkit-user-drag: none;
}

.card-slice {
    position: absolute;
    top: -18px;
    height: 290px;
    left: 50%;
    transform-style: preserve-3d;
}

.card-slice-front,
.card-slice-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    outline: 1px solid transparent;
}

.card-slice-front {
    transform: rotateY(0deg) translateZ(0.5px);
}

.card-slice-back {
    transform: rotateY(180deg) translateZ(0.5px);
}

.card-slice-content {
    position: absolute;
    top: 0;
    left: 0;
    height: 290px;
    background: #1b1a16;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid #333;
    cursor: pointer;
    transition: background 0.3s ease;
}

.card-slice-content:hover {
    background: #25231e;
}

.dark .card-slice-content {
    background: #1b1a16;
    border: 1px solid #333;
}

.dark .card-slice-content:hover {
    background: #25231e;
}

.carousel-card-img {
    width: 100%;
    height: 115px;
    background: #222;
    border-radius: 8px;
    margin-bottom: auto;
    transition: transform 0.3s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
    image-rendering: -webkit-optimize-contrast;
}

.card-slice-content:hover .carousel-card-img {
    transform: scale(1.05) translateZ(0);
}

.card-slice-content h3 {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0.75rem 0 0.25rem 0;
    color: #fff;
    line-height: 1.1;
}

.card-slice-content p {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 768px) {
    .carousel-scene {
        height: 30vh;
    }

    .hero-title-container {
        top: -15%;
        margin-top: 0;
    }

    .carousel-container {
        width: 200px;
        height: 280px;
        transform: scale(0.40);
    }

    .carousel-tilt {
        margin-top: 25vh;
    }

    .hero-title-main {
        font-size: clamp(1rem, 10.5vw, 4rem);
        padding: 0 4vw;
    }
}