/* =========================
   Form Templates
   ========================= */

   body {
    background: linear-gradient(180deg, #FEFDFB 0%, #FFF8F3 100%);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.templates-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 0.75rem;
    letter-spacing: -2px;
}

.page-subtitle {
    font-size: 1.25rem;
    color: #6B6B6B;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.info-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFE8D6 0%, #FFD4B8 100%);
    color: #D97757;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.template-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #F0F0F0;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.6s ease-out both;
}

.template-card:nth-child(1) { animation-delay: 0.1s; }
.template-card:nth-child(2) { animation-delay: 0.15s; }
.template-card:nth-child(3) { animation-delay: 0.2s; }
.template-card:nth-child(4) { animation-delay: 0.25s; }
.template-card:nth-child(5) { animation-delay: 0.3s; }
.template-card:nth-child(6) { animation-delay: 0.35s; }

.template-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: #E0E0E0;
}

.template-header {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.template-icon {
    font-size: 4.5rem;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

.template-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    background-size: 30px 30px;
}

/* Fonds par catégorie */
.category-entrees .template-header {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.category-plats .template-header {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}

.category-desserts .template-header {
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
}

.category-pains .template-header {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
}

.category-soupes .template-header {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.category-boissons .template-header {
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
}

.category-aperitifs .template-header {
    background: linear-gradient(135deg, #FBE9E7 0%, #FFCCBC 100%);
}

.category-salades .template-header {
    background: linear-gradient(135deg, #E0F2F1 0%, #B2DFDB 100%);
}

.category-viandes .template-header {
    background: linear-gradient(135deg, #EFEBE9 0%, #D7CCC8 100%);
}

.category-poissons .template-header {
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
}

.category-vegetarien .template-header {
    background: linear-gradient(135deg, #F1F8E9 0%, #DCEDC8 100%);
}

.category-patisserie .template-header {
    background: linear-gradient(135deg, #FFF9C4 0%, #FFF59D 100%);
}

/* Fond par défaut */
.category-default .template-header {
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
}

.template-body {
    padding: 2rem;
}

.template-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.template-description {
    color: #6B6B6B;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.template-btn {
    width: 100%;
    background: #2C2C2C;
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.template-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 44, 44, 0.2);
    color: white;
}

.back-section {
    text-align: center;
    padding: 2rem 0;
}

.btn-back {
    background: white;
    color: #2C2C2C;
    border: 2px solid #E8E8E8;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    border-color: #2C2C2C;
    color: #2C2C2C;
    transform: translateY(-2px);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .template-header {
        height: 150px;
    }

    .template-icon {
        font-size: 3.5rem;
    }
}