/* =========================================
   STYLE GLOBAL & RESET
   ========================================= */
:root {
    --apple-bg: #f5f5f7;
    --apple-blue: #0071e3;
    --apple-gray: #86868b;
    --apple-dark: #1d1d1f;
    --glass: rgba(255, 255, 255, 0.75);
    --shadow-soft: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-premium: 0 10px 30px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--apple-bg);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    color: var(--apple-dark);
}

/* SUPPRESSION DE L'OUTLINE BLEU (Correction demandée) */
button, input, select, textarea, .option-card, .doc-client-row, .nav-btn {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* =========================================
   LAUNCHER (UserPicker & AppLauncher)
   ========================================= */
#userPicker, #appLauncher {
    padding: 60px 20px;
    text-align: center;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}

.option-card {
    background: #fff;
    border-radius: 24px;
    padding: 30px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-premium);
}

.icon-box {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
}

/* =========================================
   COMPOSANTS STUDIO (Cartes, Boutons, Inputs)
   ========================================= */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.studio-btn {
    background: var(--apple-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.studio-btn:hover { opacity: 0.9; transform: scale(0.98); }

.studio-btn.sec {
    background: #e8e8ed;
    color: var(--apple-dark);
}

.studio-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d2d2d7;
    background: #fff;
    margin-top: 5px;
    font-size: 1rem;
}

.studio-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--apple-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

/* =========================================
   MODALES
   ========================================= */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}

.modal-window {
    background: white;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 28px;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

/* =========================================
   DOCUSAFE SPECIFIC
   ========================================= */
.doc-client-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; border-radius: 12px; cursor: pointer;
    transition: 0.2s; border: 1px solid transparent;
}
.doc-client-row:hover { background: #e8e8ed !important; }
.doc-client-row.active { border-color: var(--apple-blue) !important; background: #fff !important; }

/* =========================================
   GESTION DE L'IMPRESSION (DEVIS PDF)
   ========================================= */
@media print {
    /* Cache les menus, boutons et fonds d'écran */
    #studioNav, .nav-btn, .studio-btn, .header-flex, #appLauncher, #userPicker {
        display: none !important;
    }

    body {
        background: white !important;
    }

    #studioContent {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    /* Force la modale (le devis) à prendre toute la page A4 */
    .modal {
        position: absolute !important;
        background: white !important;
        display: block !important;
        overflow: visible !important;
    }

    .modal-window {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Optimisation des textes pour le PDF */
    h1, h2, h3 { color: black !important; }
    .card { border: 1px solid #eee !important; box-shadow: none !important; }
    
    /* Force l'affichage des couleurs bleues du logo/titres */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* =========================================
   GRID LAYOUTS UTILS
   ========================================= */
.header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.studio-grid { display: grid; gap: 20px; }