/* WP Formation Booking - Public Styles */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --wfb-primary: #1a3a5c;
    --wfb-secondary: #2980b9;
    --wfb-accent: #e67e22;
    --wfb-success: #27ae60;
    --wfb-warning: #f39c12;
    --wfb-danger: #e74c3c;
    --wfb-light: #f8f9fa;
    --wfb-border: #e1e8ef;
    --wfb-text: #2c3e50;
    --wfb-muted: #6c757d;
    --wfb-radius: 12px;
    --wfb-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --wfb-font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

.wfb-formations-grid,
.wfb-single-formation,
.wfb-reservation-form-wrap,
.wfb-confirmation,
.wfb-no-formations {
    font-family: var(--wfb-font);
    color: var(--wfb-text);
    line-height: 1.6;
}

/* ==== FORMATIONS GRID ==== */
.wfb-formations-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}
.wfb-cols-1 { grid-template-columns: 1fr; }
.wfb-cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.wfb-cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Formation Card */
.wfb-formation-card {
    background: #fff;
    border-radius: var(--wfb-radius);
    box-shadow: var(--wfb-shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--wfb-border);
    display: flex;
    flex-direction: column;
}
.wfb-formation-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.wfb-card-indisponible { opacity: 0.75; }

.wfb-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}
.wfb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.wfb-formation-card:hover .wfb-card-image img { transform: scale(1.05); }
.wfb-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(231,76,60,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 3px;
}

.wfb-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.wfb-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wfb-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.wfb-card-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.wfb-meta-item { font-size: 0.85rem; color: var(--wfb-muted); }
.wfb-card-description { font-size: 0.9rem; color: #555; margin-bottom: 16px; flex: 1; }

.wfb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--wfb-border);
}
.wfb-price { font-size: 1.2rem; font-weight: 700; color: var(--wfb-accent); }

/* Badges */
.wfb-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.wfb-badge-complet   { background: #fde8e8; color: var(--wfb-danger); }
.wfb-badge-warning   { background: #fff3cd; color: #856404; }
.wfb-badge-disponible{ background: #d4f8e8; color: #155724; }

/* ==== BUTTONS ==== */
.wfb-btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: var(--wfb-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
}
.wfb-btn-primary {
    background: linear-gradient(135deg, var(--wfb-secondary), var(--wfb-primary));
    color: #fff;
}
.wfb-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(41,128,185,0.35); }
.wfb-btn-disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

/* ==== RESERVATION FORM ==== */
.wfb-reservation-form-wrap {
    background: #fff;
    border-radius: var(--wfb-radius);
    padding: 30px;
    box-shadow: var(--wfb-shadow);
    border: 1px solid var(--wfb-border);
    max-width: 700px;
    margin: 20px auto;
}
.wfb-reservation-form-wrap h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--wfb-primary);
    margin: 0 0 6px 0;
}
.wfb-formation-info { color: var(--wfb-muted); font-size: 0.95rem; margin-bottom: 16px; }
.wfb-places-info { margin-bottom: 20px; }

.wfb-form { display: flex; flex-direction: column; gap: 0; }
.wfb-form-row { display: flex; gap: 16px; }
.wfb-form-row-2 > .wfb-field { flex: 1; }
.wfb-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.wfb-field label { font-size: 0.9rem; font-weight: 600; color: var(--wfb-text); }
.wfb-required { color: var(--wfb-danger); }
.wfb-field input[type="text"],
.wfb-field input[type="email"],
.wfb-field input[type="tel"] {
    padding: 11px 14px;
    border: 1.5px solid var(--wfb-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--wfb-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}
.wfb-field input:focus {
    border-color: var(--wfb-secondary);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
    outline: none;
    background: #fff;
}
.wfb-field input.wfb-error { border-color: var(--wfb-danger); }

.wfb-terms-field { margin-top: 4px; }
.wfb-checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; cursor: pointer; }
.wfb-checkbox-label input { margin-top: 3px; width: 16px; height: 16px; }

.wfb-form-messages { margin: 8px 0; }
.wfb-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 8px 0;
}
.wfb-alert-success { background: #d4f8e8; color: #155724; border-left: 4px solid var(--wfb-success); }
.wfb-alert-error   { background: #fde8e8; color: #721c24; border-left: 4px solid var(--wfb-danger); }
.wfb-alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--wfb-warning); }
.wfb-alert-info    { background: #cce5ff; color: #004085; border-left: 4px solid var(--wfb-secondary); }

.wfb-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--wfb-border);
}
.wfb-total { font-size: 1.1rem; font-weight: 700; color: var(--wfb-primary); }
.wfb-btn-submit { width: auto; min-width: 200px; }

/* Loading spinner */
.wfb-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wfbSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes wfbSpin { to { transform: rotate(360deg); } }

/* ==== MODAL ==== */
.wfb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,58,92,0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 20px;
}
.wfb-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    animation: wfbModalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
@keyframes wfbModalIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.wfb-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wfb-muted);
    z-index: 1;
    transition: color 0.2s;
    line-height: 1;
}
.wfb-modal-close:hover { color: var(--wfb-danger); }
#wfb-modal-content { padding: 30px; }

/* ==== SINGLE FORMATION ==== */
.wfb-single-formation { max-width: 800px; margin: 0 auto; }
.wfb-single-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--wfb-radius); margin-bottom: 24px; }
.wfb-single-formation h2 { font-size: 1.8rem; color: var(--wfb-primary); margin-bottom: 16px; }
.wfb-single-meta { background: var(--wfb-light); border-radius: var(--wfb-radius); padding: 20px; margin-bottom: 24px; display: grid; gap: 10px; }
.wfb-meta-row { display: flex; gap: 10px; font-size: 0.95rem; }
.wfb-single-description { margin-bottom: 30px; }

/* ==== CONFIRMATION PAGE ==== */
.wfb-confirmation {
    max-width: 680px;
    margin: 30px auto;
    padding: 40px;
    border-radius: var(--wfb-radius);
    box-shadow: var(--wfb-shadow);
    text-align: center;
}
.wfb-confirmation-success { background: linear-gradient(135deg, #f0fff4, #d4f8e8); border: 2px solid var(--wfb-success); }
.wfb-confirmation-pending { background: linear-gradient(135deg, #fffdf0, #fff3cd); border: 2px solid var(--wfb-warning); }
.wfb-confirmation-cancel  { background: linear-gradient(135deg, #fff5f5, #fde8e8); border: 2px solid var(--wfb-danger); }
.wfb-confirmation-icon { font-size: 4rem; margin-bottom: 16px; }
.wfb-confirmation h2 { font-size: 1.6rem; color: var(--wfb-primary); margin-bottom: 16px; }
.wfb-confirmation-details { text-align: left; background: #fff; border-radius: 10px; padding: 20px; margin-top: 24px; }
.wfb-confirmation-details h3 { font-size: 1rem; color: var(--wfb-primary); margin: 0 0 16px 0; }
.wfb-confirm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.wfb-confirm-table th { padding: 8px 12px; background: var(--wfb-light); text-align: left; font-weight: 600; border: 1px solid var(--wfb-border); width: 40%; }
.wfb-confirm-table td { padding: 8px 12px; border: 1px solid var(--wfb-border); }

/* ==== NO FORMATIONS ==== */
.wfb-no-formations { text-align: center; padding: 40px; color: var(--wfb-muted); }

@media (max-width: 600px) {
    .wfb-form-row { flex-direction: column; }
    .wfb-form-footer { flex-direction: column; }
    .wfb-btn-submit { width: 100%; }
    .wfb-confirmation { padding: 24px; }
}
