/**
 * Styles for candidature modals, forms and card action buttons
 * Used by [demg_supabase_mandats], [demg_supabase_commissions],
 * [demg_supabase_services] and dedicated candidature shortcodes.
 *
 * Les styles des pages detail (.demg-detail-*) sont dans shortcode-supabase-detail.css
 */

/* ========== Card footer with action button ========== */
.demg-sc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.demg-sc-seats-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

.demg-sc-seats-badge--full {
    background: #fee2e2;
    color: #991b1b;
}

.demg-sc-btn-candidater,
.demg-sc-btn-demander {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid #2F2483;
    background: transparent;
    color: #2F2483;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.demg-sc-btn-candidater:hover,
.demg-sc-btn-demander:hover {
    background: #2F2483;
    color: #fff;
}

.demg-sc-btn-candidater .dashicons,
.demg-sc-btn-demander .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ========== Modal overlay & container ========== */
.demg-candidature-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demg-candidature-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.demg-candidature-modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: demgModalSlideIn 0.25s ease-out;
}

@keyframes demgModalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== Modal header ========== */
.demg-candidature-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #2F2483 0%, #662282 100%);
    color: #fff;
}

.demg-candidature-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff !important;
}

.demg-candidature-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.demg-candidature-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

/* ========== Modal body / form ========== */
.demg-candidature-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.demg-candidature-form .demg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.demg-candidature-form .demg-form-group {
    display: flex;
    flex-direction: column;
}

.demg-candidature-form .demg-form-group--full {
    grid-column: 1 / -1;
}

.demg-candidature-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.demg-candidature-form label .demg-required {
    color: #E4002C;
    margin-left: 2px;
}

.demg-candidature-form input[type="text"],
.demg-candidature-form input[type="email"],
.demg-candidature-form input[type="tel"],
.demg-candidature-form select,
.demg-candidature-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.demg-candidature-form input:focus,
.demg-candidature-form select:focus,
.demg-candidature-form textarea:focus {
    outline: none;
    border-color: #2F2483;
    box-shadow: 0 0 0 3px rgba(47, 36, 131, 0.12);
}

.demg-candidature-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* ========== Modal footer ========== */
.demg-candidature-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.demg-candidature-btn-cancel {
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.demg-candidature-btn-cancel:hover {
    background: #f3f4f6;
}

.demg-candidature-btn-submit {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2F2483 0%, #662282 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.demg-candidature-btn-submit:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(47, 36, 131, 0.3);
}

.demg-candidature-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Success message ========== */
.demg-candidature-success {
    text-align: center;
    padding: 40px 24px;
}

.demg-candidature-success .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #059669;
    margin-bottom: 12px;
}

.demg-candidature-success h4 {
    font-size: 1.1rem;
    color: #065f46;
    margin: 0 0 8px;
}

.demg-candidature-success p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

/* ========== Error message ========== */
.demg-candidature-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    color: #991b1b;
    font-size: 0.85rem;
    display: none;
}

/* ========== Dedicated shortcode page styles ========== */
.demg-candidature-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.demg-candidature-page__header {
    text-align: center;
    margin-bottom: 2rem;
}

.demg-candidature-page__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2F2483;
    margin: 0 0 0.5rem;
}

.demg-candidature-page__subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.demg-candidature-item-info {
    background: linear-gradient(135deg, #2F2483 0%, #662282 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.demg-candidature-item-info h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    color: #fff !important;
}

.demg-candidature-item-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    color: #fff !important;
}

.demg-candidature-inline-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ========== Clickable card link styling ========== */
a.demg-sc-mandats__card--link,
a.demg-sc-commissions__card--link,
a.demg-sc-services__card--link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

a.demg-sc-mandats__card--link:hover,
a.demg-sc-commissions__card--link:hover,
a.demg-sc-services__card--link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(47, 36, 131, 0.15);
}

.demg-sc-card-arrow {
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
}

a:hover .demg-sc-card-arrow {
    color: #2F2483;
    transform: translateX(3px);
}

.demg-sc-card-arrow .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
    .demg-candidature-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .demg-candidature-form .demg-form-row {
        grid-template-columns: 1fr;
    }

    .demg-candidature-modal-footer {
        flex-direction: column;
    }

    .demg-sc-card-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
