/* ============================================================
   Design System — Julie Ears
   ============================================================ */

/* Open Sans self-hosted (WOFF2) — élimine la dépendance Google Fonts
   pour gagner LCP/FCP et éviter les FOUT. font-display: swap pour
   afficher immédiatement la fallback puis swap sans bloquer le rendu. */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/assets/fonts/open-sans-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/open-sans-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/open-sans-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/open-sans-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/open-sans-700.woff2') format('woff2');
}

:root {
    --color-rose:        #E9AFB8;
    --color-rose-dark:   #D4899A;
    --color-rose-light:  #F7DCE1;
    --color-rose-ultra:  #FDF3F5;
    --color-title:       #2D2D2D;
    --color-text:        #5A5A5A;
    --color-text-light:  #8A8A8A;
    --color-border:      #EBEBEB;
    --color-bg:          #FFFFFF;
    --color-bg-soft:     #FAFAFA;
    --color-success:     #4CAF82;
    --color-error:       #E05C5C;
    --color-warning:     #F0A045;
    --color-info:        #5B9BD5;
    --shadow-rose:       0 4px 20px rgba(233,175,184,0.35);
    --shadow-sm:         0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:         0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:         0 8px 30px rgba(0,0,0,0.12);
    --font-family:       'Open Sans', sans-serif;
    --radius-sm:         8px;
    --radius-md:         12px;
    --radius-lg:         16px;
    --radius-xl:         24px;
    --transition:        all 0.2s ease;
}

/* ── Mode sombre ──────────────────────────────────────────── */
body.dark {
    --color-rose-light:  #3D2A35;
    --color-rose-ultra:  #2A2035;
    --color-title:       #F0F0F0;
    --color-text:        #C8C8D0;
    --color-text-light:  #8888A0;
    --color-border:      #2A2A45;
    --color-bg:          #1A1A2E;
    --color-bg-soft:     #16162A;
    --shadow-rose:       0 4px 20px rgba(233,175,184,0.15);
    --shadow-sm:         0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:         0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg:         0 8px 30px rgba(0,0,0,0.4);
}

body.dark .badge-success {
    background: #1B3A2A;
    color: #6FCF97;
}

body.dark .badge-warning {
    background: #3A2E1B;
    color: #F0A045;
}

body.dark .badge-error {
    background: #3A1B1B;
    color: #E88;
}

body.dark .badge-info {
    background: #1B2A3A;
    color: #7BBBEA;
}

body.dark .alert-success {
    background: #1B3A2A;
    color: #6FCF97;
    border-color: #2A4A35;
}

body.dark .alert-error {
    background: #3A1B1B;
    color: #E88;
    border-color: #4A2A2A;
}

body.dark .alert-warning {
    background: #3A2E1B;
    color: #F0A045;
    border-color: #4A3A2A;
}

body.dark .alert-info {
    background: #1B2A3A;
    color: #7AB8E8;
    border-color: #2A3A4A;
}

body.dark .form-input {
    background: #222240;
    color: var(--color-title);
}

body.dark .form-input::placeholder {
    color: #666688;
}

body.dark .btn-secondary {
    background: #222240;
    color: var(--color-text);
    border-color: var(--color-border);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg-soft);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-rose-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-rose);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 {
    color: var(--color-title);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 0.75rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-rose);
    color: #fff;
    box-shadow: var(--shadow-rose);
}

.btn-primary:hover {
    background: var(--color-rose-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(233,175,184,0.45);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-rose);
    color: var(--color-rose-dark);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    color: #fff;
}

.btn-danger {
    background: var(--color-error);
    color: #fff;
}

.btn-danger:hover {
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

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

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-title);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--color-title);
    background: var(--color-bg);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-rose);
    box-shadow: 0 0 0 3px rgba(233,175,184,0.2);
}

.form-input::placeholder {
    color: var(--color-text-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--color-rose);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-rose {
    background: var(--color-rose-ultra);
    color: var(--color-rose-dark);
}

.badge-success {
    background: #E8F5E9;
    color: var(--color-success);
}

.badge-warning {
    background: #FFF3E0;
    color: var(--color-warning);
}

.badge-error {
    background: #FFEBEE;
    color: var(--color-error);
}

.badge-info {
    background: #E3F0FA;
    color: var(--color-info);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #BBDEFB;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-sm {
    max-width: 480px;
}

.container-md {
    max-width: 720px;
}

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-rose);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-rose { color: var(--color-rose-dark); }
.text-light { color: var(--color-text-light); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ── Header ────────────────────────────────────────────────── */
.header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-title);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo-img {
    height: 38px;
}

.header .btn-sm,
.admin-header .btn-sm {
    height: 36px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .header-logo-img {
        height: 62px;
    }
}

/* ── Page layout (footer toujours en bas) ─────────────────── */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.footer {
    margin-top: auto;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    width: 100%;
    background: #1E1E1E;
    padding: 48px 24px 24px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    box-sizing: border-box;
}

.footer-main {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.footer-brand {
    max-width: 260px;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 16px;
}

.footer-logo-img {
    height: 36px;
}

.footer-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2A2A2A;
    border: 1px solid #3A3A3A;
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
}

.footer-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-family: var(--font-family);
    cursor: pointer;
    min-width: 0;
}

.footer-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-rose);
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.footer-send-btn:hover {
    background: var(--color-rose-dark);
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.footer-col a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    margin: 0;
}

.footer-col a:hover {
    color: var(--color-rose);
}

.footer-login-link {
    color: var(--color-rose) !important;
    font-weight: 600;
    margin-top: 4px;
}

.footer-separator {
    max-width: 1100px;
    margin: 32px auto 20px;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-socials a {
    color: rgba(255,255,255,0.4);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-socials a:hover {
    color: var(--color-rose);
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ── Pages légales ─────────────────────────────────────────── */
.legal-page {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px 60px;
    width: 100%;
    box-sizing: border-box;
}
.legal-page h1 { font-size: 1.5rem; margin-bottom: 24px; color: var(--color-title); }
.legal-page h2 { font-size: 1.1rem; margin-top: 32px; margin-bottom: 12px; color: var(--color-title); }
.legal-page h3 { font-size: 0.95rem; margin-top: 20px; margin-bottom: 8px; color: var(--color-title); }
.legal-page p,
.legal-page li { font-size: 0.9rem; line-height: 1.7; color: var(--color-text); margin-bottom: 8px; }
.legal-page ul { padding-left: 20px; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.85rem; }
.legal-page th,
.legal-page td { padding: 10px 12px; border: 1px solid var(--color-border); text-align: left; }
.legal-page th { background: var(--color-bg-soft); font-weight: 600; }
.legal-update { font-size: 0.8rem; color: var(--color-text-light); margin-top: 40px; }
.legal-highlight { background: var(--color-rose-ultra); border-left: 4px solid var(--color-rose); padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0; }

/* Breadcrumb (fil d'Ariane sémantique) */
.breadcrumb { margin-bottom: 24px; font-size: 0.85rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--color-rose-dark); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-text-light); }
.breadcrumb-current { color: var(--color-text-light); font-weight: 500; }

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .container {
        padding: 0 32px;
    }
}
