:root {
    --bg: #0b1220;
    --brand: #ff5a4e;
    --brand-2: #ff7a6e;
    --text: #ffffff;
    --muted: #cbd5e1;
    --line: rgba(255, 255, 255, 0.16);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* ---------- Lettres animées (logo) ---------- */

.ch {
    display: inline-block;
    animation: letterIn 0.9s var(--ease-out) both;
    animation-delay: calc(0.35s + var(--i, 0) * 0.11s);
}

.ch.q {
    margin-left: 0.18em;
    color: #ff6b5e;
    transform-origin: 50% 80%;
    animation:
        letterIn 0.9s var(--ease-out) both,
        wobble 3.2s ease-in-out infinite;
    animation-delay: calc(0.35s + var(--i, 0) * 0.11s), 2s;
}

/* ---------- Boutons ---------- */

.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 2.2rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.3s var(--ease-out), background 0.3s ease, box-shadow 0.3s ease;
}

.btn i {
    transition: transform 0.3s var(--ease-out);
}

.btn:hover {
    transform: translateY(-3px) scale(1.03);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn--block {
    width: 100%;
}

.btn--primary {
    background: var(--brand);
    animation: glowPulse 2.6s ease-in-out 1s infinite;
}

.btn--primary:hover {
    background: #ff6f64;
}

.btn--primary:hover i {
    transform: translateX(5px);
}

.btn--primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: shine 3.8s ease-in-out 1.6s infinite;
}

.btn--ghost {
    background: rgba(8, 14, 28, 0.55);
    border-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover i {
    transform: translateX(4px);
}

/* Chargement */
.btn.is-loading {
    pointer-events: none;
}

.btn.is-loading i {
    display: none;
}

.btn.is-loading::before {
    content: '';
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: max(6.5rem, env(safe-area-inset-bottom));
    z-index: 300;
    max-width: calc(100% - 2rem);
    padding: 0.8rem 1.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(8, 14, 28, 0.92);
    border: 1px solid var(--line);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, 30px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s var(--ease-back), opacity 0.3s ease;
}

.toast.is-show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.toast.is-success {
    border-color: rgba(74, 222, 128, 0.7);
}

.toast.is-error {
    border-color: rgba(255, 107, 107, 0.8);
}

/* ---------- Keyframes communes ---------- */

@keyframes letterIn {
    0%   { opacity: 0; transform: translateY(50px) rotate(6deg) scale(0.85); filter: blur(12px); }
    100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); filter: blur(0); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0) scale(1); }
    20%      { transform: rotate(-12deg) scale(1.1); }
    40%      { transform: rotate(10deg) scale(1.1); }
    60%      { transform: rotate(-5deg) scale(1.04); }
    80%      { transform: rotate(0) scale(1); }
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes glowIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(255, 90, 78, 0.4), 0 0 0 0 rgba(255, 90, 78, 0.45); }
    50%      { box-shadow: 0 10px 25px rgba(255, 90, 78, 0.4), 0 0 0 14px rgba(255, 90, 78, 0); }
}

@keyframes shine {
    0%, 55% { left: -80%; }
    100%    { left: 140%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Accessibilité : réduire les animations ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}