/* ============================================================
   APTEVIA - Design System global
   Fichier : theme_aptevia.css
   Version : V1.4 – 2025-12-07
   Rôle : Source unique du design (couleurs, polices, UI)
   ============================================================ */

/* ===========================================
   PALETTE (APTEVIA BLEU + TAUPE + BEIGE)
=========================================== */
:root {
    /* Couleurs principales */
    --color-bg-page:        #F7F4EF;
    --color-bg-section:     #FAF8F4;

    --color-primary:        #002F3F;
    --color-primary-dark:   #001E29;

    --color-accent:         #A89E8F;
    --color-accent-light:   #D6D0C8;
    --color-accent-dark:    #8A8174;

    --color-white:          #FFFFFF;

    --color-text:           #333333;
    --color-text-soft:      #555555;
    --color-text-faded:     #777777;
    --color-border-soft:    #DDDDDD;

    --color-error:          #C1272D;
    --color-success:        #5A8F00;

    /* Polices */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
                 sans-serif;

    /* Typographie */
    --font-size-base:   16px;
    --font-size-small:  14px;
    --font-size-large:  18px;
    --font-size-xl:     24px;
    --font-size-xxl:    32px;

    --line-height-base:   1.55;
    --line-height-title:  1.25;

    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Ombres */
    --shadow-soft:   0 2px 6px rgba(0,0,0,0.06);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-strong: 0 8px 24px rgba(0,0,0,0.14);
    --shadow-popup:  0 15px 40px rgba(0,0,0,0.25);

    /* Espacements */
    --space-xxs: 4px;
    --space-xs:  6px;
    --space-sm:  12px;
    --space-md:  20px;
    --space-lg:  40px;
    --space-xl:  60px;
}

/* ===========================================
   BASE
=========================================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-bg-page);
    -webkit-font-smoothing: antialiased;
    line-height: var(--line-height-base);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    color: var(--color-primary);
    margin: 0 0 15px;
    letter-spacing: 0.2px;
}

/* ===========================================
   BOUTONS GLOBAUX
=========================================== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-primary:hover { background: #001c26; }

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-accent-light); }

.btn-light {
    background: var(--color-white);
    border: 1px solid var(--color-border-soft);
    color: var(--color-primary);
}

/* ===========================================
   CARTES
=========================================== */
.card {
    background: var(--color-white);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-soft);
}

/* ===========================================
   FORMULAIRES
=========================================== */
input, select, textarea {
    width: 100%;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-soft);
    font-size: 1rem;
    background: var(--color-white);
    box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(168,158,143,0.30);
}

/* ===========================================
   LOADER (IA)
=========================================== */
.psy-circle {
    width: 80px;
    height: 80px;
    border: 6px solid var(--color-accent-light);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1.3s linear infinite;
    margin: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================
   TABLES
=========================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: var(--color-accent-light);
    padding: var(--space-sm);
}
.table td {
    border-bottom: 1px solid var(--color-border-soft);
    padding: var(--space-sm);
}

/* ===========================================
   LETTRES DILA (pages longues)
=========================================== */
.lettre-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text);
}
.lettre-content h1 { font-size: 2rem; }
.lettre-content h2 { font-size: 1.4rem; margin-top: 40px; }

.lettre-content p { margin-bottom: 14px; }
.lettre-content ul { margin: 10px 0 20px 25px; }

.lettre-content hr { display: none !important; }

.section-sep {
    border-top: 2px solid var(--color-accent);
    width: 60%;
    margin: 25px auto;
}

.lettre-content a:hover { color: var(--color-accent); }

/* ===========================================
   LIENS "Voir aussi" DILA
=========================================== */
.lettre-related {
    margin-top: 50px;
    padding-top: 20px;
}

.lettre-related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
}

.lettre-related-btn {
    display: block;
    padding: 12px 18px;
    background: var(--color-bg-page);
    border: 1px solid var(--color-accent-light);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease-in-out;
}

.lettre-related-btn:hover {
    background: var(--color-accent-light);
    color: var(--color-primary);
}

/* ===========================================
   VERSION IMPRIMABLE PDF
=========================================== */
@media print {

    header,
    footer,
    .header-container,
    .header-right,
    nav,
    .lettre-share,
    .lettre-related,
    .btn,
    .btn-header {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000 !important;
        margin: 0;
        padding: 0;
        font-size: 12pt !important;
    }

    .lettre-content {
        margin: 0;
        padding: 30px;
        width: 100%;
        max-width: 100%;
        color: #000 !important;
        box-shadow: none;
        background: #fff !important;
    }

    .lettre-content h1 {
        font-size: 22pt !important;
        margin-top: 0;
    }

    .lettre-content h2 {
        font-size: 16pt !important;
        margin-top: 25px;
    }

    body::before {
        content: url('/assets/img/logo.png');
        display: block;
        margin-bottom: 20px;
        width: 140px;
    }

    body::after {
        content: "APTEVIA — Tests psychotechniques | www.aptevia.fr";
        display: block;
        position: fixed;
        bottom: 10px;
        left: 30px;
        right: 30px;
        text-align: center;
        font-size: 10pt;
        color: #555;
    }
}

/* ============================================================
   APTEVIA - Popup connexion espace pro
   (aucun impact sur popup RDV)
============================================================ */
.login-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.login-popup.is-open {
    display: flex;
}

.login-popup-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 460px;
    width: 100%;
    padding: 32px 36px 30px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.20);
    border-top: 6px solid #99cf16;
}

.login-title {
    text-align: center;
    font-size: 1.6rem;
    color: #002f3f;
    margin: 0 0 4px;
}

.login-subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 24px;
}

.login-popup-box label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #002f3f;
    margin-bottom: 6px;
}

.login-popup-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.98rem;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.login-error {
    background: #ffe6e6;
    color: #c0392b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    text-align: center;
}
/* ============================================================
   RGPD – composant unifié (checkbox + texte alignés)
============================================================ */
.rgpd-row {
  margin-top: 10px;
}

.rgpd-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
  font-weight: 500;
  color: #4e4e4e;
  cursor: pointer;
}

.rgpd-label input[type="checkbox"] {
  margin: 2px 0 0 0;     /* aligne la checkbox sur la 1re ligne du texte */
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--color-clear, #99cf16); /* fallback si variable absente */
  cursor: pointer;
}

.rgpd-label span {
  display: inline;
}

.rgpd-label a {
  color: var(--color-primary, #002f3f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rgpd-label a:hover {
  text-decoration-thickness: 2px;
}
