/* ==========================================================================
   Modale d'inscription contextuelle — page recette
   Scroll-lock : meme pattern que hero-v2-modals (scrollbar visible, body fixed)
   ========================================================================== */

/* Scroll lock — html garde la scrollbar visible, body bloque le scroll */
html.inscription-modal-open {
    overflow-y: scroll;
}

body.inscription-modal-open {
    position: fixed;
    width: 100%;
    top: calc(var(--scroll-top, 0px) * -1);
}

/* Overlay */
.inscription-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.inscription-modal-overlay.active {
    display: block;
    opacity: 1;
}

/* Modale */
.inscription-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border-radius: 18px;
    z-index: 9999;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.inscription-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Bouton fermer */
.inscription-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s ease;
}

.inscription-modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Section recette (photo + titre) */
.inscription-modal-recette {
    position: relative;
}

.inscription-modal-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
    display: block;
}

.inscription-modal-recette-info {
    padding: 20px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inscription-modal-action-label {
    font-size: 1.1rem;
    color: var(--primary-color, #ff6b6b);
    font-weight: 600;
}

.inscription-modal-recette-titre {
    font-size: 1.1rem;
    color: var(--text-color, #333);
    line-height: 1.3;
    font-weight: 600;
}

/* Section CTA */
.inscription-modal-cta {
    padding: 20px 24px 28px;
}

.inscription-modal-cta h3 {
    font-size: 1.15rem;
    margin: 0 0 8px;
    color: var(--text-color, #333);
}

.inscription-modal-cta > p {
    font-size: 0.88rem;
    color: var(--text-light, #666);
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Bouton Google OAuth */
.inscription-modal-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    background: #fff;
    color: #3c4043;
    border: 1.5px solid #dadce0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inscription-modal-btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.inscription-modal-google-icon {
    flex-shrink: 0;
}

/* Separateur */
.inscription-modal-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-light, #999);
    font-size: 0.82rem;
}

.inscription-modal-separator::before,
.inscription-modal-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(128, 128, 128, 0.2);
}

/* Boutons Connexion / Inscription (style auth-badge du hamburger) */
.inscription-modal-auth-buttons {
    display: flex;
    gap: 10px;
}

.inscription-modal-auth-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inscription-modal-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.inscription-modal-auth-btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-color: #ff6b6b;
    color: white;
}

.inscription-modal-auth-btn-primary:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    border-color: #ff5252;
    color: white;
}

/* ==========================================================================
   Dark mode
   ========================================================================== */

html.dark-mode .inscription-modal {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

html.dark-mode .inscription-modal-close {
    background: rgba(255, 255, 255, 0.15);
}

html.dark-mode .inscription-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

html.dark-mode .inscription-modal-btn-google {
    background: #3a3a3a;
    border-color: #555;
    color: #f0f0f0;
}

html.dark-mode .inscription-modal-btn-google:hover {
    background: #444;
    border-color: #666;
    color: #fff;
}

html.dark-mode .inscription-modal-auth-btn {
    background: #3a3a3a;
    border-color: #555;
    color: #f0f0f0;
}

html.dark-mode .inscription-modal-auth-btn:hover {
    background: #444;
    border-color: #666;
    color: #fff;
}

html.dark-mode .inscription-modal-auth-btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-color: #ff6b6b;
    color: white;
}

html.dark-mode .inscription-modal-auth-btn-primary:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
    border-color: #ff5252;
    color: white;
}

html.dark-mode .inscription-modal-separator {
    color: rgba(255, 255, 255, 0.4);
}

html.dark-mode .inscription-modal-separator::before,
html.dark-mode .inscription-modal-separator::after {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Mobile responsive
   ========================================================================== */

@media (max-width: 480px) {
    .inscription-modal {
        width: 95%;
        border-radius: 14px;
    }

    .inscription-modal-img {
        height: 160px;
        border-radius: 14px 14px 0 0;
    }

    .inscription-modal-cta {
        padding: 16px 20px 24px;
    }

    .inscription-modal-recette-info {
        padding: 16px 20px 0;
    }

    .inscription-modal-auth-buttons {
        gap: 8px;
    }

    .inscription-modal-auth-btn {
        padding: 12px 12px;
        font-size: 13.5px;
    }
}
