/* ============================================================================
   Meditae — Feuille de styles principale
   Design : futuriste premium / glassmorphism / holographique.
   Palette : #050816 / #111827 / #00E5FF / #7C3AED / #FFFFFF
   ========================================================================== */

/* ----------------------------- VARIABLES ---------------------------------- */
:root {
    --bg:        #050816;
    --bg-2:      #111827;
    --cyan:      #00E5FF;
    --violet:    #7C3AED;
    --text:      #FFFFFF;
    --muted:     #9aa4bf;

    --glass-bg:    rgba(17, 24, 39, 0.55);
    --glass-brd:   rgba(255, 255, 255, 0.10);
    --glass-blur:  18px;

    --radius:    20px;
    --radius-sm: 12px;
    --shadow:    0 20px 60px rgba(0, 0, 0, 0.45);
    --glow-cyan: 0 0 30px rgba(0, 229, 255, 0.35);
    --grad:      linear-gradient(135deg, var(--cyan), var(--violet));
    --grad-soft: linear-gradient(135deg, rgba(0,229,255,.18), rgba(124,58,237,.18));

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Thème clair */
[data-theme="light"] {
    --bg:    #eef1f8;
    --bg-2:  #ffffff;
    --text:  #0b1020;
    --muted: #51607a;
    --glass-bg:  rgba(255, 255, 255, 0.70);
    --glass-brd: rgba(10, 16, 32, 0.08);
    --shadow:    0 20px 50px rgba(31, 45, 80, 0.15);
}

/* ----------------------------- BASE --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; }

/* ----------------------------- FOND ANIMÉ --------------------------------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.aurora__blob {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
    animation: floatBlob 18s var(--ease) infinite alternate;
}
.aurora__blob--1 { width: 480px; height: 480px; background: var(--cyan);   top: -120px; left: -80px; }
.aurora__blob--2 { width: 520px; height: 520px; background: var(--violet); bottom: -160px; right: -100px; animation-delay: -6s; }
.aurora__blob--3 { width: 360px; height: 360px; background: #2563eb;       top: 40%; left: 55%; animation-delay: -10s; }

@keyframes floatBlob {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(60px,-40px) scale(1.15); }
}

.particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ----------------------------- GLASSMORPHISM ------------------------------ */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-brd);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}
/* Reflet lumineux holographique sur le bord supérieur */
.glass::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, rgba(0,229,255,.5), transparent 40%, transparent 60%, rgba(124,58,237,.5));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none; opacity: .6;
}

/* ----------------------------- BOUTONS ------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .7rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
    white-space: nowrap; position: relative; overflow: hidden;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--glow-cyan); }
.btn--primary:hover { box-shadow: 0 0 40px rgba(0,229,255,.55); }
.btn--ghost {
    background: rgba(255,255,255,.05); border: 1px solid var(--glass-brd);
    backdrop-filter: blur(8px); color: var(--text);
}
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--danger { color: #ff6b8a; }
.btn--danger:hover { background: rgba(255,107,138,.12); }
.btn--lg    { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn--sm    { padding: .45rem .85rem; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- TEXTE GRADIENT ----------------------------- */
.grad-text {
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------------------------- LOGO --------------------------------------- */
.logo-orb {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: var(--grad); color: #fff; box-shadow: var(--glow-cyan);
}
.logo-text { font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; }

/* ============================================================================
   LANDING PAGE
   ========================================================================== */
.navbar {
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
    width: min(1200px, 92%); z-index: 50; padding: .7rem 1.4rem; border-radius: 999px;
    display: flex; align-items: center; justify-content: space-between;
}
.navbar__brand { display: flex; align-items: center; gap: .6rem; }
.navbar__links { display: flex; align-items: center; gap: 1.4rem; }
.navbar__links a { color: var(--muted); font-weight: 500; transition: color .2s; }
.navbar__links a:hover { color: var(--text); }
.navbar__burger { display: none; font-size: 1.3rem; }

.hero {
    min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center;
    gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 8rem 1.5rem 4rem;
}
.hero__title { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; margin: 1rem 0; }
.hero__subtitle { font-size: 1.2rem; color: var(--muted); max-width: 32rem; }
.hero__cta { display: flex; gap: 1rem; margin: 2rem 0; flex-wrap: wrap; }
.badge {
    display: inline-flex; gap: .5rem; align-items: center; padding: .4rem 1rem; border-radius: 999px;
    background: var(--grad-soft); border: 1px solid var(--glass-brd); font-size: .85rem; color: var(--cyan);
}
.hero__stats { display: flex; gap: 2.5rem; margin-top: 1.5rem; }
.hero__stats strong { display: block; font-size: 1.8rem; background: var(--grad);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero__stats span { color: var(--muted); font-size: .85rem; }

/* Orbe holographique */
.hero__visual { display: grid; place-items: center; }
.orb-core {
    width: 320px; height: 320px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 30% 30%, rgba(0,229,255,.35), rgba(124,58,237,.15) 60%, transparent 70%);
    position: relative; font-size: 4rem; color: var(--cyan);
    animation: pulseOrb 4s ease-in-out infinite;
}
.orb-ring {
    position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(0,229,255,.4);
    animation: spin 12s linear infinite;
}
.orb-ring--2 { inset: 24px; border-color: rgba(124,58,237,.5); animation-duration: 9s; animation-direction: reverse; }
.orb-ring--3 { inset: 48px; border-color: rgba(255,255,255,.15); animation-duration: 16s; }
@keyframes pulseOrb { 50% { transform: scale(1.05); } }

/* Sections */
.section { max-width: 1200px; margin: 0 auto; padding: 5rem 1.5rem; text-align: center; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.section__lead { color: var(--muted); margin: 1rem auto 3rem; max-width: 40rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.card { padding: 2rem; text-align: left; transition: transform .35s var(--ease); }
.card:hover { transform: translateY(-6px); }
.card__icon {
    width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
    background: var(--grad-soft); color: var(--cyan); font-size: 1.5rem; margin-bottom: 1rem;
}
.card h3 { margin-bottom: .5rem; }
.card p  { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.4rem; }
.step { padding: 2rem; text-align: center; }
.step span {
    width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem;
    background: var(--grad); color: #fff; font-weight: 800; font-size: 1.2rem;
}
.step p { color: var(--muted); }

.contact { max-width: 640px; margin: 0 auto; padding: 2.5rem; }
.footer { text-align: center; padding: 2.5rem; color: var(--muted); border-top: 1px solid var(--glass-brd); }

/* ----------------------------- FORMULAIRES -------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input {
    width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm);
    background: rgba(255,255,255,.05); border: 1px solid var(--glass-brd); color: var(--text);
    font-size: .95rem; transition: border .2s, box-shadow .2s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.15); }
.input--sm { padding: .5rem .8rem; width: auto; }
.field { position: relative; display: flex; align-items: center; }
.field > i { position: absolute; left: 1rem; color: var(--muted); }
.field .input { padding-left: 2.6rem; }
.link-muted { color: var(--muted); font-size: .85rem; align-self: flex-end; }
.link-muted:hover { color: var(--cyan); }

/* ----------------------------- GÉNÉRATEUR --------------------------------- */
.panel { padding: 1.6rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    margin-bottom: 1.2rem; font-size: 1.15rem; }
.panel__head i { color: var(--cyan); margin-right: .4rem; }
.generator { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.5rem; align-items: start; }
/* Variante centrée pour le générateur intégré à la page d'accueil. */
.generator--center { max-width: 1100px; margin: 0 auto; text-align: left; }

.char-counter { font-size: .85rem; color: var(--muted); }
.textarea-wrap { position: relative; margin-top: 1rem; }
.textarea { min-height: 340px; resize: vertical; line-height: 1.7; }
.drop-hint {
    position: absolute; inset: 0; display: none; place-items: center; flex-direction: column; gap: .5rem;
    border-radius: var(--radius-sm); background: var(--grad-soft); border: 2px dashed var(--cyan);
    color: var(--cyan); font-weight: 600; pointer-events: none;
}
.textarea-wrap.is-dragover .drop-hint { display: grid; }
.draft-note { color: var(--muted); font-size: .8rem; margin-top: .6rem; }

.label { display: block; font-weight: 600; font-size: .85rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .5px; margin: 1.2rem 0 .6rem; }
.chips { display: flex; gap: .5rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: 999px;
    background: rgba(255,255,255,.05); border: 1px solid var(--glass-brd); color: var(--muted);
    font-size: .88rem; font-weight: 500; transition: .25s var(--ease); white-space: nowrap;
}
.chip--sm { padding: .4rem .75rem; font-size: .82rem; }
.chip:hover { color: var(--text); border-color: var(--cyan); }
.chip.is-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow-cyan); }

.sliders { display: grid; gap: 1rem; margin-top: 1.4rem; }
.slider-row label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted);
    margin-bottom: .4rem; }
.slider-row output { color: var(--cyan); font-weight: 600; }
input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
    background: rgba(255,255,255,.12); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--grad);
    box-shadow: var(--glow-cyan); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%;
    background: var(--cyan); cursor: pointer; }

.toggles { display: flex; gap: 1.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: .6rem; font-size: .9rem; cursor: pointer; }
.toggle input { display: none; }
.toggle span { width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.15);
    position: relative; transition: .25s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; transition: .25s; }
.toggle input:checked + span { background: var(--grad); }
.toggle input:checked + span::after { transform: translateX(18px); }

/* ----------------------------- RÉSULTAT / LECTEUR ------------------------- */
.result-panel { margin-top: 1.5rem; }
.result__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
    gap: 1rem; margin-bottom: 1.2rem; }
.result__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.player { display: flex; align-items: center; gap: 1rem; }
.player__play { width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff;
    font-size: 1.2rem; display: grid; place-items: center; box-shadow: var(--glow-cyan); flex-shrink: 0; }
.player__bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.12);
    cursor: pointer; overflow: hidden; }
.player__progress { height: 100%; width: 0%; background: var(--grad); }
.player__time { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* ----------------------------- OVERLAY GÉNÉRATION ------------------------- */
.gen-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
    background: rgba(5,8,22,.78); backdrop-filter: blur(8px); }
.gen-overlay__box { padding: 2.5rem 3rem; text-align: center; width: min(420px, 92%); }
.gen-orb { width: 110px; height: 110px; margin: 0 auto 1.5rem; display: grid; place-items: center;
    position: relative; font-size: 2rem; color: var(--cyan); }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); margin: 1.4rem 0 .8rem;
    overflow: hidden; }
.progress__bar { height: 100%; width: 0%; background: var(--grad); transition: width .4s var(--ease); }
#genStatus { color: var(--muted); font-size: .9rem; }

/* ----------------------------- TOASTS ------------------------------------- */
.toast-stack { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; display: flex;
    flex-direction: column; gap: .7rem; }
.toast { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.2rem; border-radius: var(--radius-sm);
    background: var(--glass-bg); border: 1px solid var(--glass-brd); backdrop-filter: blur(12px);
    box-shadow: var(--shadow); min-width: 260px; }
.toast i { font-size: 1.1rem; }
.toast--success i { color: #34d399; }
.toast--error i   { color: #ff6b8a; }
.toast--info i    { color: var(--cyan); }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 7rem; }
    .hero__visual { order: -1; }
    .hero__cta, .hero__stats { justify-content: center; }
    .generator { grid-template-columns: 1fr; }
    .navbar__links { display: none; }
    .navbar__links.is-open {
        display: flex; flex-direction: column; position: absolute; top: 70px; right: 0;
        width: 220px; padding: 1.2rem; gap: 1rem;
        background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--radius);
        backdrop-filter: blur(14px);
    }
    .navbar__burger { display: block; }
}

@media (max-width: 768px) {
    .form__row { grid-template-columns: 1fr; }
}

/* ----------------------------- ANIMATIONS UTILES -------------------------- */
[data-anim] { opacity: 0; }   /* révélés par GSAP, fallback ci-dessous */
.no-gsap [data-anim] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    [data-anim] { opacity: 1 !important; }
}
