/* ==========================================================================
   FRYNZY BUSINESS & AD PLATFORM (VAYLIO) — CSS STYLESHEET
   Style iPhone Apple / WhatsApp Business épuré, moderne et haut de gamme
   ========================================================================== */

/* Écrans Outils Business & Promouvoir */
.frynzy-biz-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8fafc;
    background-image: radial-gradient(at 10% 10%, rgba(255, 255, 255, 0.98) 0px, transparent 65%),
                      radial-gradient(at 90% 90%, rgba(241, 245, 249, 0.94) 0px, transparent 65%);
    z-index: 100000;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    color: #000000;
    animation: frynzySlideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.frynzy-biz-page.active {
    display: flex;
}

/* Header style iPhone (Noir et Blanc Épuré) */
.frynzy-biz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(54px + max(var(--sat, 44px), env(safe-area-inset-top, 44px)));
    height: calc(54px + max(var(--sat, 44px), env(safe-area-inset-top, 44px)));
    padding: max(var(--sat, 44px), env(safe-area-inset-top, 44px)) 16px 0 16px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.frynzy-biz-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.frynzy-biz-back-btn {
    background: none;
    border: none;
    font-size: 1.18rem;
    color: #000000;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.frynzy-biz-back-btn:active {
    background: rgba(0, 0, 0, 0.06);
}

.frynzy-biz-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #000000;
}

.frynzy-biz-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.frynzy-biz-menu-btn {
    background: none;
    border: none;
    font-size: 1.15rem;
    color: #000000;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.frynzy-biz-menu-btn:active {
    background: rgba(0, 0, 0, 0.06);
}

/* Corps défilable */
.frynzy-biz-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(36px + max(var(--sab, 24px), env(safe-area-inset-bottom, 24px))) 16px;
    box-sizing: border-box;
}

/* Section Performance */
.frynzy-biz-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.frynzy-biz-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.2px;
}

.frynzy-biz-info-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #4b5563;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.frynzy-biz-info-btn:active {
    background: #000000;
    color: #ffffff;
}

/* Grille des 3 métriques (WhatsApp style) */
.frynzy-biz-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.frynzy-biz-metric-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 14px;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.frynzy-biz-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 8px;
}

.frynzy-biz-metric-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.frynzy-biz-metric-lbl {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.2;
}

/* Carte Call-To-Action "Pour Vous / Créer votre première pub" */
.frynzy-biz-promo-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.frynzy-biz-promo-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.frynzy-biz-promo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #007aff 0%, #0051ba 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

.frynzy-biz-promo-text {
    flex: 1;
}

.frynzy-biz-promo-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 5px;
    letter-spacing: -0.2px;
}

.frynzy-biz-promo-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.frynzy-biz-btn-primary {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: transform 0.1s ease, background 0.15s ease;
}

.frynzy-biz-btn-primary:active {
    transform: scale(0.98);
    background: #1e293b;
}

/* Modale Explication des performances */
.frynzy-biz-info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.frynzy-biz-info-item:last-child {
    border-bottom: none;
}

.frynzy-biz-info-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.frynzy-biz-info-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 3px;
}

.frynzy-biz-info-text {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

/* Vue Auth Requise dans Promouvoir */
.frynzy-biz-auth-box {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 32px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.frynzy-biz-auth-shield {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.frynzy-biz-auth-msg {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 22px;
    max-width: 320px;
}

/* Carte Profil Utilisateur Connecté */
.frynzy-biz-profile-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.frynzy-biz-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.frynzy-biz-user-name {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.frynzy-biz-user-email {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.frynzy-biz-verified-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    background: #ecfdf5;
    color: #059669;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sélecteurs Modèle & Cible (Cartes épurées) */
.frynzy-biz-picker-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: border-color 0.15s ease;
}

.frynzy-biz-picker-card:active {
    border-color: #007aff;
    background: #fbfdff;
}

.frynzy-biz-picker-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.frynzy-biz-picker-val-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.frynzy-biz-picker-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: #007aff;
}

/* Zone d'import médias */
.frynzy-biz-upload-box {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.frynzy-biz-upload-box:active {
    border-color: #007aff;
    background: #f0f7ff;
}

.frynzy-biz-upload-icon {
    font-size: 2rem;
    color: #64748b;
    margin-bottom: 10px;
}

.frynzy-biz-upload-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.frynzy-biz-upload-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.frynzy-biz-thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.frynzy-biz-thumb-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.frynzy-biz-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frynzy-biz-thumb-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Champs de formulaire */
.frynzy-biz-form-group {
    margin-bottom: 16px;
}

.frynzy-biz-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.frynzy-biz-input,
.frynzy-biz-select,
.frynzy-biz-textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.92rem;
    color: #0f172a;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.frynzy-biz-input:focus,
.frynzy-biz-select:focus,
.frynzy-biz-textarea:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.frynzy-biz-counter {
    text-align: right;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Preview interactif dans le formulaire */
.frynzy-biz-preview-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.frynzy-biz-preview-media-box {
    width: 100%;
    height: 280px;
    background: #0f172a;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.frynzy-biz-preview-media-box video,
.frynzy-biz-preview-media-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.frynzy-biz-preview-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 5;
}

.frynzy-biz-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.frynzy-biz-dot.active {
    width: 18px;
    border-radius: 4px;
    background: #ffffff;
}

/* ==========================================================================
   SIMULATION PLEIN ÉCRAN DE LA PUBLICITÉ (STORIES / SHORTS)
   ========================================================================== */
.frynzy-sim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 1000000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.frynzy-sim-overlay.active {
    display: flex;
}

/* Header de simulation avec croix de fermeture */
.frynzy-sim-header {
    position: absolute;
    top: max(var(--sat, 40px), env(safe-area-inset-top, 40px));
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    pointer-events: auto;
}

.frynzy-sim-sponsor-tag {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.frynzy-sim-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    color: #ffffff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.frynzy-sim-close-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Conteneur média plein écran */
.frynzy-sim-media-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.frynzy-sim-media-stage video,
.frynzy-sim-media-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge flottant 3 secondes au centre */
.frynzy-sim-floating-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 25px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: frynzyPulseBadge 1.5s infinite;
}

@keyframes frynzyPulseBadge {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.04); }
}

/* Barre d'application supérieure pour mode App */
.frynzy-sim-app-badge {
    position: absolute;
    top: calc(max(var(--sat, 40px), env(safe-area-inset-top, 40px)) + 50px);
    left: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 30;
}

.frynzy-sim-app-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
}

.frynzy-sim-app-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

/* Pied de page de la publicité avec description & CTA */
.frynzy-sim-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 16px calc(24px + max(var(--sab, 20px), env(safe-area-inset-bottom, 20px))) 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
    box-sizing: border-box;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.frynzy-sim-desc-wrap {
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.frynzy-sim-see-more {
    font-weight: 800;
    color: #38bdf8;
    margin-left: 6px;
    cursor: pointer;
    text-decoration: underline;
}

.frynzy-sim-cta-btn {
    width: 100%;
    background: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    letter-spacing: -0.2px;
}

.frynzy-sim-cta-btn:active {
    background: #0056b3;
    transform: scale(0.98);
}

/* Modale Popup Pleine Description */
.frynzy-sim-desc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000005;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.frynzy-sim-desc-modal.active {
    display: flex;
}

.frynzy-sim-desc-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 22px;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.frynzy-sim-desc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.frynzy-sim-desc-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.frynzy-sim-desc-text {
    flex: 1;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 18px;
}


/* ==========================================================================
   ONLINE VALIDATION, NETWORK STATES & REALISTIC 3D DISCONNECTION ARTWORK
   ========================================================================== */
.frynzy-biz-auth-user-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.frynzy-biz-net-error-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 22px;
    text-align: center;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 16px 0;
    animation: frynzyFadeIn 0.25s ease;
}

.frynzy-biz-3d-artwork {
    width: 100%;
    max-width: 200px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.frynzy-biz-net-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.frynzy-biz-net-desc {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 22px;
    max-width: 320px;
}

.frynzy-biz-btn-retry {
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 13px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
    transition: transform 0.15s ease, background 0.2s ease;
}
.frynzy-biz-btn-retry:active {
    transform: scale(0.96);
    background: #1e293b;
}

.frynzy-biz-checking-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 38px 20px;
    text-align: center;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    animation: frynzyFadeIn 0.2s ease;
}

.frynzy-biz-spinner {
    width: 38px;
    height: 38px;
    border: 3.5px solid #e2e8f0;
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: frynzySpin 0.75s linear infinite;
    margin-bottom: 16px;
}

@keyframes frynzySpin {
    to { transform: rotate(360deg); }
}

.frynzy-biz-checking-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
}
