/* =================================================================
   ID44 — Espace Client (EC) — Styles
   Chargé uniquement pour le portail client.
   Composants partagés → style.css
   ================================================================= */

/* ---- Modal portail client ---- */
/* =================================================================
   ID44 — Espace Client (EC) — Styles
   Chargé uniquement pour le portail client.
   Les variables de couleur sont définies dans style.css.
   ================================================================= */


/* ---- Client portal modal ---- */
.ec-portal-box {
    background: #fff;
    border-radius: 20px;
    width: 94%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

@media (max-width: 768px) {
    body.ec-client-mode {
        overflow: hidden !important;
    }

    body.ec-client-mode>*:not(#ecPortalOverlay):not(.ec-overlay):not(#ecSignatureOverlay):not(#ecPDFPreviewOverlay) {
        display: none !important;
    }

    #ecPortalOverlay {
        z-index: 2147483640 !important;
        background: #ffffff !important;
    }

    .ec-portal-box {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .ec-hide-mobile {
        display: none !important;
    }

    .ec-devis-header-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .ec-devis-actions-desktop {
        display: none !important;
    }

    .ec-devis-actions-mobile {
        display: flex !important;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 10px;
        width: 100%;
    }

    .ec-devis-btn-group-mobile {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
    }
}

.ec-devis-actions-mobile {
    display: none;
}

.ec-portal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #00D0FF, #10B981);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ec-portal-header h2 {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.ec-portal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.ec-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ec-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ---- Login card ---- */
.ec-login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #00D0FF, #10B981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}


/* ---- Login / formulaire ---- */

.ec-input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 44px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: #f8fafc !important;
    color: #1f2937;
    box-shadow: none !important;
}

.ec-input:focus {
    border-color: #00D0FF;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 208, 255, 0.1) !important;
}

.ec-input:disabled {
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    border-color: #e2e8f0;
    opacity: 0.7;
}

@media (prefers-color-scheme: dark) {
    .ec-input {
        background-color: #1e293b !important;
        border-color: #334155;
        color: #f1f5f9;
    }
    .ec-input:focus {
        background-color: #0f172a;
        border-color: #00D0FF;
    }
    .ec-input:disabled {
        background-color: #0f172a !important;
        color: #475569 !important;
        border-color: #1e293b;
        opacity: 0.5;
    }
    
    .ec-portal-box {
        background-color: #0f172a;
    }
    .ec-header-bar {
        background-color: #1e293b;
        border-color: #334155;
    }
    .ec-client-name { color: #f1f5f9; }
    .ec-mission-card {
        background-color: #1e293b;
        border-color: #334155;
    }
    .ec-mission-ref { color: #f1f5f9; }
    .ec-montant { color: #f1f5f9; }
}


.ec-btn-primary {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #00D0FF, #10B981);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.ec-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ec-error {
    color: #ef4444;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
    display: none;
}

/* ---- Dashboard client ---- */
.ec-dashboard {
    display: none;
}

.ec-header-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ec-client-name {
    font-weight: 700;
    color: #1f2937;
    font-size: 1rem;
}

.ec-client-code {
    font-size: 0.78rem;
    color: #6b7280;
}

.ec-logout-btn {
    padding: 0.4rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ec-logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.ec-info-box {
    background: linear-gradient(135deg, rgba(0, 208, 255, 0.07), rgba(16, 185, 129, 0.07));
    border: 1px solid rgba(0, 208, 255, 0.2);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #374151;
}

.ec-mission-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.875rem;
    border-left: 4px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.ec-mission-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

.ec-mission-card.statut-en_attente {
    border-left-color: #e5e7eb;
}

.ec-mission-card.statut-paye {
    border-left-color: #10B981;
}

.ec-mission-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.ec-mission-ref {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.95rem;
}

.ec-mission-date {
    font-size: 0.78rem;
    color: #9ca3af;
}


/* ---- Détails mission / paiement / RIB ---- */
.ec-mission-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px solid #f3f4f6;
}

.ec-montant {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1f2937;
}

.ec-btn-pay {
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ec-btn-pay:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ec-btn-download {
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s, transform 0.1s;
}

.ec-btn-download:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}

/* ---- Payment sub-modal ---- */
.ec-pay-box {
    background: #fff;
    border-radius: 18px;
    width: 94%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.ec-pay-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ec-pay-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
}

.ec-pay-iframe {
    width: 100%;
    height: 480px;
    border: none;
    flex: 1;
}

.ec-pay-success {
    display: none;
    text-align: center;
    padding: 2rem;
}

.ec-pay-success.active {
    display: block;
}

.ec-rib-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.ec-rib-row {
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.82rem;
    gap: 0.75rem;
}

.ec-rib-key {
    color: #6b7280;
    font-weight: 500;
    width: 85px;
    flex-shrink: 0;
}

.ec-rib-val {
    color: #1f2937;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    flex: 1;
    word-break: break-all;
}

.ec-rib-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #92400e;
}

/* ---- Animations ---- */
@keyframes ecPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(100, 116, 139, 0);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.2);
    }
}

@keyframes ecPulseGlowGreen {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
    }
}

@keyframes ecPulseGlowYellow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(234, 179, 8, 0.3);
    }
}

/* Fix signature overlay z-index to be above everything */
#ecSignatureOverlay {
    z-index: 2147483647 !important;
}

/* Base styles for keeping icons and text on same line */
.ec-devis-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Animation Premium : Bordure de gradient qui parcourt en continu le cadre */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.ec-devis-gradient-border {
    position: relative;
    border: 1.2px solid transparent;
    border-radius: 12px;
    /* Fallback statique pour navigateurs anciens */
    background: linear-gradient(white, white) padding-box,
        linear-gradient(90deg, #00D0FF, #10B981, #8b5cf6, #00D0FF) border-box;
    background-size: 200% auto !important;
    box-shadow: 0 10px 25px -10px rgba(0, 208, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: ec-rotate-gradient 4s linear infinite !important;
}

/* Rendu Premium avec conic-gradient si supporté */
@supports (background: conic-gradient(from 0deg, red, blue)) {
    .ec-devis-gradient-border {
        background: linear-gradient(white, white) padding-box,
            conic-gradient(from var(--angle), #00D0FF, #10B981, #8b5cf6, #00D0FF) border-box;
    }
}

.ec-devis-gradient-border:hover {
    box-shadow: 0 15px 35px -12px rgba(0, 208, 255, 0.6);
    transform: translateY(-2px);
}

@keyframes ec-rotate-gradient {
    0% {
        --angle: 0deg;
        background-position: 0% 50%;
        /* Fallback animation */
    }

    100% {
        --angle: 360deg;
        background-position: 200% 50%;
        /* Fallback animation */
    }
}

/* ---- Contact section (Espace Client) ---- */
.ec-contact-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ec-contact-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center; gap: 8px;
}

.ec-contact-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    background: #ffffff;
    margin-bottom: 1rem;
}

.ec-contact-textarea:focus {
    border-color: #00D0FF;
    background: #ffffff;
}

.ec-contact-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ec-btn-attach {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ec-btn-attach:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ec-btn-send-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00D0FF, #10B981);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0, 208, 255, 0.2);
}

.ec-btn-send-msg:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.ec-btn-send-msg:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ec-file-preview {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 600;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 768px) {
    .ec-contact-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ec-btn-send-msg {
        justify-content: center;
    }
}
.ec-spin {
    animation: ec-spin 1s linear infinite;
}

@keyframes ec-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* =================================================================
   FIN DES STYLES
   ================================================================= */
