/* ===== Arolle Conseil — Portail Conformité v2 ===== */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700&family=Barlow+Condensed:wght@400;500;600;700&display=swap');

:root {
    --sable: #ba9973;
    --sable-light: #d4bfa0;
    --sable-pale: #e8d5c0;
    --ocre: #a9582b;
    --ocre-dark: #8a4522;
    --ocean: #499fa4;
    --ocean-light: #7bbfc3;
    --sun: #eddf9c;
    --sun-light: #f5edc5;
    --grey: #545454;
    --grey-light: #a0968c;
    --grey-pale: #b5ada4;
    --brown-dark: #3b2e24;
    --brown-deeper: #2c2118;
    --bg: #faf8f5;
    --bg-card: #ffffff;
    --border: rgba(186,153,115,0.12);
    --border-hover: rgba(186,153,115,0.25);
    --white: #ffffff;
    --danger: #c0392b;
    --danger-light: #fce8e8;
    --danger-text: #b52a2a;
    --success: #1a7a5a;
    --success-light: #e6f5f0;
    --success-text: #1a7a5a;
    --warning: #e67e22;
    --warning-light: #fef3e2;
    --warning-text: #b45e10;
    --info: #499fa4;
    --info-light: #e6f3f4;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: 0.15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Barlow', sans-serif;
    color: var(--grey);
    background: var(--bg);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
}

.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px; background: var(--brown-dark); padding: 28px 20px;
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo { text-align: center; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid rgba(186,153,115,0.15); }
.sidebar-logo img { max-width: 160px; height: auto; }
.sidebar-logo a { text-decoration: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px;
    border-radius: var(--radius); font-size: 14px; color: rgba(186,153,115,0.65);
    text-decoration: none; transition: var(--transition);
}
.sidebar-link:hover { background: rgba(186,153,115,0.08); color: var(--sable); text-decoration: none; }
.sidebar-link.active { background: rgba(186,153,115,0.12); color: var(--sun); font-weight: 500; }
.sidebar-link svg {
    width: 18px; height: 18px; stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.sidebar-section-label { font-size: 10px; letter-spacing: 1.5px; color: rgba(186,153,115,0.35); padding: 20px 14px 6px; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(186,153,115,0.12); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ocre); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; color: var(--sable); font-weight: 500; }
.sidebar-user-email { font-size: 11px; color: rgba(186,153,115,0.45); }
.sidebar-logout { display: block; margin-top: 12px; font-size: 12px; color: rgba(186,153,115,0.4); text-decoration: none; }
.sidebar-logout:hover { color: var(--danger); text-decoration: none; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; margin-left: 250px; padding: 32px 40px; min-height: 100vh; }

/* ===== AUTH PAGES ===== */
.auth-layout { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.auth-container { width: 100%; max-width: 440px; padding: 0 24px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo-img { max-width: 180px; margin-bottom: 8px; }
.auth-logo { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 32px; color: var(--ocre); letter-spacing: 3px; }
.auth-logo-sub { font-family: 'Barlow Condensed', sans-serif; font-weight: 500; font-size: 14px; color: var(--sable); letter-spacing: 4px; display: block; }
.auth-title { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; color: var(--grey-light); margin-top: 1rem; font-weight: 400; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 14px; color: var(--grey-light); }
.auth-footer a { color: var(--ocre); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ===== PAGE HEADERS ===== */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.page-title { font-size: 24px; font-weight: 500; color: var(--brown-dark); letter-spacing: -0.3px; }
.page-subtitle { font-size: 13px; color: var(--grey-light); margin-top: 4px; }
h1 { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 24px; color: var(--brown-dark); margin-bottom: 1.5rem; }
h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 18px; color: var(--ocre); margin-bottom: 1rem; }
h3 { font-weight: 600; font-size: 15px; color: var(--sable); margin-bottom: 0.5rem; }

/* ===== CARDS ===== */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.card + .card { margin-top: 0.75rem; }

/* ===== CONFORMITY BAR ===== */
.conformity-bar { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px; display: flex; align-items: center; gap: 24px; border: 1px solid var(--border); }
.conformity-left { flex: 1; }
.conformity-label { font-size: 12px; color: var(--grey-light); letter-spacing: 0.5px; margin-bottom: 8px; }
.conformity-track { height: 6px; background: #ede8e0; border-radius: 3px; overflow: hidden; }
.conformity-fill { height: 6px; border-radius: 3px; background: var(--ocean); transition: width 0.5s ease; }
.conformity-value { font-size: 32px; font-weight: 500; color: var(--ocean); letter-spacing: -1px; text-align: right; }
.conformity-sub { font-size: 11px; color: var(--grey-light); text-align: right; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 36px; font-weight: 600; line-height: 1; }
.stat-label { font-size: 12px; color: var(--grey-light); margin-top: 4px; }
.stat-card.conforme .stat-value { color: var(--success); }
.stat-card.non-conforme .stat-value { color: var(--danger); }
.stat-card.partiel .stat-value { color: var(--warning); }
.stat-card.total .stat-value { color: var(--ocre); }

/* ===== DOCUMENT ROWS ===== */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px 22px; display: flex; align-items: center; gap: 18px; border: 1px solid var(--border); transition: var(--transition); }
.doc-row:hover { border-color: var(--border-hover); }
.doc-row.alert-border { border-left: 3px solid var(--warning); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.doc-row.danger-border { border-left: 3px solid var(--danger); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.doc-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-icon svg { width: 20px; height: 20px; stroke: var(--white); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 14px; font-weight: 500; color: var(--brown-dark); }
.doc-hint { font-size: 12px; color: var(--grey-pale); margin-top: 2px; }
.doc-days { text-align: right; min-width: 100px; flex-shrink: 0; }
.doc-days-num { font-size: 18px; font-weight: 500; letter-spacing: -0.5px; }
.doc-days-label { font-size: 11px; color: var(--grey-pale); }

/* ===== DOCUMENT CARDS ===== */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.doc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: var(--transition); }
.doc-card:hover { border-color: var(--border-hover); }
.doc-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.doc-card-title { font-weight: 500; font-size: 14px; color: var(--brown-dark); }
.doc-card-desc { font-size: 12px; color: var(--grey-pale); margin-bottom: 12px; line-height: 1.5; }
.doc-card-meta { font-size: 12px; color: var(--grey-pale); }
.doc-card-meta span { display: block; margin-top: 2px; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-verified { background: var(--success-light); color: var(--success-text); }
.badge-pending { background: #f0ebe4; color: var(--ocre); }
.badge-rejected { background: var(--danger-light); color: var(--danger-text); }
.badge-expired { background: #f5e0e0; color: #8b2020; }
.badge-missing { background: var(--danger-light); color: var(--danger-text); }
.badge-conforme { background: var(--success-light); color: var(--success-text); }
.badge-non_conforme { background: var(--danger-light); color: var(--danger-text); }
.badge-partiel { background: var(--warning-light); color: var(--warning-text); }
.badge-start { background: #f0ebe4; color: var(--ocre); }

/* ===== DAYS REMAINING ===== */
.days-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: var(--radius); }
.days-safe { background: var(--success-light); color: var(--success-text); }
.days-warn { background: var(--warning-light); color: var(--warning-text); }
.days-danger { background: var(--danger-light); color: var(--danger-text); }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--brown-dark); color: var(--sable-light); font-weight: 500; text-align: left; padding: 12px 16px; font-size: 12px; letter-spacing: 0.5px; }
th:first-child { border-radius: var(--radius) 0 0 0; }
th:last-child { border-radius: 0 var(--radius) 0 0; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(186,153,115,0.03); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; font-size: 13px; color: var(--grey); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid rgba(186,153,115,0.2); border-radius: var(--radius); font-family: 'Barlow', sans-serif; font-size: 15px; color: var(--grey); background: var(--white); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--ocre); box-shadow: 0 0 0 3px rgba(169,88,43,0.08); }
.form-control::placeholder { color: var(--grey-pale); }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--grey-light); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border: none; border-radius: var(--radius); font-family: 'Barlow', sans-serif; font-weight: 500; font-size: 13px; cursor: pointer; transition: var(--transition); text-decoration: none; letter-spacing: 0.2px; }
.btn-primary { background: var(--ocre); color: var(--white); }
.btn-primary:hover { background: var(--ocre-dark); text-decoration: none; }
.btn-secondary { background: var(--sable); color: var(--white); }
.btn-secondary:hover { background: #a08560; text-decoration: none; }
.btn-outline { background: transparent; border: 1px solid rgba(186,153,115,0.25); color: var(--grey); }
.btn-outline:hover { border-color: var(--ocre); color: var(--ocre); text-decoration: none; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-google { background: var(--white); border: 1px solid rgba(186,153,115,0.2); color: var(--grey); font-weight: 500; padding: 12px 24px; }
.btn-google:hover { background: var(--bg); border-color: var(--sable); text-decoration: none; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 0; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.alert-success { background: var(--success-light); color: var(--success-text); border-left: 3px solid var(--success); }
.alert-error { background: var(--danger-light); color: var(--danger-text); border-left: 3px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning-text); border-left: 3px solid var(--warning); }
.alert-info { background: var(--info-light); color: var(--info); border-left: 3px solid var(--info); }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.5; padding: 0 4px; }

/* ===== ONBOARDING ===== */
.onboarding-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 2rem; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grey-pale); }
.step.active { color: var(--ocre); font-weight: 500; }
.step.done { color: var(--success); }
.step-number { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; border: 2px solid var(--grey-pale); color: var(--grey-pale); }
.step.active .step-number { border-color: var(--ocre); color: var(--white); background: var(--ocre); }
.step.done .step-number { border-color: var(--success); color: var(--white); background: var(--success); }
.step-line { width: 48px; height: 2px; background: #e0dbd4; margin: 0 10px; }
.step-line.done { background: var(--success); }

/* ===== UPLOAD ZONE ===== */
.upload-zone { border: 2px dashed rgba(186,153,115,0.3); border-radius: var(--radius); padding: 1.5rem; text-align: center; cursor: pointer; transition: var(--transition); background: rgba(186,153,115,0.02); }
.upload-zone:hover { border-color: var(--ocre); background: rgba(169,88,43,0.03); }
.upload-zone input[type="file"] { display: none; }
.upload-zone-text { font-size: 14px; color: var(--grey-light); }
.upload-zone-text strong { color: var(--ocre); }

/* ===== DECLARATION FLOW ===== */
.declaration-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; max-width: 640px; }
.declaration-question { font-size: 15px; font-weight: 500; color: var(--brown-dark); margin-bottom: 16px; }
.declaration-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.declaration-option { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: var(--transition); font-size: 14px; }
.declaration-option:hover { border-color: var(--ocre); }
.declaration-option.selected { border-color: var(--ocre); background: rgba(169,88,43,0.04); }
.declaration-option input[type="radio"] { accent-color: var(--ocre); }
.declaration-legal { font-size: 12px; color: var(--grey-light); line-height: 1.7; padding: 16px; background: rgba(186,153,115,0.04); border-radius: var(--radius); margin-top: 16px; }
.declaration-legal a { color: var(--ocean); }
.attestation-box { background: rgba(186,153,115,0.04); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; font-size: 13px; line-height: 1.7; color: var(--grey); }
.attestation-box strong { color: var(--brown-dark); }

/* ===== FOOTER ===== */
.footer { margin-left: 250px; background: var(--white); border-top: 1px solid var(--border); padding: 16px 40px; }
.footer-content { display: flex; justify-content: space-between; font-size: 12px; color: var(--grey-light); }
.footer-auth { text-align: center; padding: 24px; font-size: 12px; color: var(--grey-light); }

/* ===== MISC ===== */
a { color: var(--ocre); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--grey-light); }
.text-sm { font-size: 13px; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.section { margin-bottom: 2.5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Mobile hamburger */
.mobile-header { display: none; background: var(--brown-dark); padding: 12px 16px; position: fixed; top: 0; left: 0; right: 0; z-index: 200; }
.mobile-header-inner { display: flex; align-items: center; justify-content: space-between; }
.mobile-logo img { height: 32px; }
.hamburger { background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger svg { width: 24px; height: 24px; stroke: var(--sable); fill: none; stroke-width: 2; stroke-linecap: round; }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 150; }
.mobile-overlay.active { display: block; }
.sidebar.mobile-open { transform: translateX(0); }

@media (max-width: 900px) {
    .sidebar { width: 200px; }
    .main-content, .footer { margin-left: 200px; }
}

@media (max-width: 768px) {
    .mobile-header { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
        z-index: 300;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 72px 16px 24px; }
    .footer { margin-left: 0; padding: 12px 16px; }
    .footer-content { flex-direction: column; gap: 4px; text-align: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .form-row { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 12px; }
    .page-title { font-size: 20px; }
    .conformity-bar { flex-direction: column; gap: 12px; }
    .conformity-value { text-align: left; font-size: 28px; }
    .conformity-sub { text-align: left; }

    /* Doc rows mobile */
    .doc-row { flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
    .doc-icon { width: 36px; height: 36px; }
    .doc-icon svg { width: 18px; height: 18px; }
    .doc-info { flex: 1; min-width: calc(100% - 54px); order: 1; }
    .doc-name { font-size: 14px; }
    .doc-hint { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .doc-days { order: 2; min-width: auto; text-align: left; }
    .doc-days-num { font-size: 15px; }
    .badge { font-size: 10px; padding: 3px 8px; }

    /* Tables mobile */
    table { font-size: 12px; }
    th, td { padding: 8px 10px; }

    /* Auth container mobile */
    .auth-container { padding: 0 12px; }
    .onboarding-steps { gap: 0; }
    .step { font-size: 11px; }
    .step-line { width: 24px; margin: 0 4px; }
    .step-number { width: 26px; height: 26px; font-size: 11px; }
}

@media (min-width: 769px) {
    .mobile-header { display: none !important; }
    .mobile-overlay { display: none !important; }
}
