/* ============================================================
   RGPD Cavac — Public CSS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@500&display=swap');


/* --- Reset & Variables --- */

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

:root {
	--cavac-green: #7ab648;
	--cavac-dark: #2c5530;
	--cavac-light: #e8f5e0;
	--primary: #3a7d44;
	--primary-dark: #2c5530;
	--primary-light: #7ab648;
	--bg: linear-gradient(135deg, #e8f0ed 0%, #f5f7f6 100%);
	--white: #ffffff;
	--text: #333;
	--text-muted: #6b7280;
	--border: #dde4db;
	--danger: #dc3545;
	--success: #198754;
	--warning: #f0ad4e;
	--radius: 10px;
	--shadow: 0 2px 8px rgba(44,85,48,.06);
	--font-heading: 'Plus Jakarta Sans', sans-serif;
	--font-body: 'DM Sans', sans-serif;
}

/* --- Base --- */

body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; font-weight: 400; -webkit-font-smoothing: antialiased; }
h1 { font-family: var(--font-heading); }
h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
.container { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

/* --- Header --- */

.header { background: linear-gradient(135deg, var(--cavac-dark) 0%, var(--primary) 100%); color: #fff; padding: 1rem 0; }
.header-inner { display: flex; align-items: center; gap: .75rem; }
.header-logo { height: 36px; width: auto; }
.header h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }
.header a { color: #fff; text-decoration: none; }
.header nav { margin-left: auto; display: flex; gap: 1.5rem; font-size: .95rem; font-weight: 500; }
.header nav a { opacity: .85; }
.header nav a:hover { opacity: 1; text-decoration: none; }

/* --- Main & Footer --- */

.main { padding: 2rem 0; min-height: 60vh; }
.footer { border-top: 1px solid var(--border); padding: 1.25rem 0; text-align: center; color: var(--text-muted); font-size: .82rem; background: var(--white); bottom: 0; width: 100%; }

/* --- Alerts --- */

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .95rem; }
.alert-danger { background: #fce4ec; color: #b71c1c; }
.alert-success { background: var(--cavac-light); color: var(--cavac-dark); }
.alert-warning { background: #fff8e1; color: #e65100; }

/* --- Buttons --- */

.btn { display: inline-block; padding: .6rem 1.3rem; border: none; border-radius: var(--radius); font-size: 1rem; cursor: pointer; font-weight: 600; font-family: var(--font-body); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { display: inline-block; padding: .55rem 1.25rem; border: 2px solid var(--primary); color: var(--primary); border-radius: var(--radius); font-weight: 600; }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-lg { padding: .75rem 2rem; font-size: 1.05rem; }

/* --- Forms --- */

fieldset { border: 0; border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; background: var(--white); }
legend { font-weight: 700; font-size: 1rem; padding: 0 .5rem; color: var(--cavac-dark); }
label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: .3rem; color: var(--text); }
input, select, textarea { font-family: var(--font-body); font-size: .95rem; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); width: 100%; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58,125,68,.12); }
select { background: var(--white); }

/* --- Shared components --- */

.confirmation { max-width: 560px; margin: 2rem auto; text-align: center; background: var(--white); border-radius: var(--radius); padding: 2.5rem; }
.confirmation-icon { font-size: 3rem; margin-bottom: .5rem; }
.confirmation h2 { margin-bottom: .5rem; color: var(--primary-dark); }
.confirmation p { color: var(--text-muted); margin: .75rem 0; line-height: 1.6; }
.confirmation-actions { margin-top: 1.5rem; display: flex; justify-content: center; gap: .75rem; }

.ref-box { background: var(--bg); border-radius: var(--radius); padding: .75rem 1rem; margin: 1rem 0; }
.ref-box code { font-size: 1.1rem; font-weight: 600; letter-spacing: 1px; }
.confirmation .ref-box { background: #f0fdf4; padding: 1rem; margin: 1.25rem 0; }
.ref-note { font-size: .8rem; margin: .25rem 0 0; }

.empty-state { text-align: center; padding: 3rem; background: var(--white); border-radius: var(--radius); }
.empty-state p { color: var(--text-muted); margin: .75rem 0 1.5rem; }

.login-box { max-width: 400px; background: var(--white); border-radius: var(--radius); padding: 2rem; line-height: 1.8; margin: 0 auto; }

/* --- Page: Home --- */

.hero { text-align: center; margin-bottom: 2rem; }
.hero h2 { font-size: 1.6rem; color: var(--cavac-dark); margin-bottom: .5rem; }
.hero p { color: var(--text-muted); max-width: 640px; margin: 0 auto; line-height: 1.7; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }
.home-card { display: block; background: var(--white); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: var(--text); transition: all .15s; box-shadow: var(--shadow); }
a.home-card:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(58,125,68,.1); text-decoration: none; transform: translateY(-2px); }
.home-card-info { grid-column: 1 / -1; }
.home-card-icon { font-size: 2rem; color: var(--primary); margin-bottom: .5rem; }
.home-card h3 { font-size: 1.1rem; color: var(--cavac-dark); margin-bottom: .35rem; }
.home-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.5; margin-bottom: .5rem; }
.home-card-link { font-size: .88rem; font-weight: 600; color: var(--primary); }
.dpo-contact { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--text); margin-top: .5rem; }
.dpo-contact i { color: var(--primary); margin-right: .3rem; }

.home-rights { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.home-rights h3 { font-size: 1.1rem; color: var(--cavac-dark); margin-bottom: 1rem; text-align: center; }
.rights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.right-item { text-align: center; }
.right-item i { font-size: 1.5rem; color: var(--primary); display: block; margin-bottom: .35rem; }
.right-item strong { display: block; font-size: .88rem; margin-bottom: .15rem; }
.right-item span { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* --- Page: Politique --- */

.politique-header { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.politique-logo { width: 80px; height: 80px; object-fit: contain; border-radius: var(--radius); background: var(--white); padding: .25rem; border: 0px solid var(--border); }
.politique-header h1 { font-size: 1.4rem; margin: 0; color: var(--cavac-dark); font-family: var(--font-heading); }
.politique-site { color: var(--text-muted); margin: .15rem 0 0; font-size: .9rem; }
.politique-content { background: var(--white); border-radius: var(--radius); padding: 2rem; line-height: 1.8; }
.politique-content h1, .politique-content h2, .politique-content h3 { margin: 1.5rem 0 .75rem; color: var(--cavac-dark); }
.politique-content h1 { font-size: 1.3rem; }
.politique-content h2 { font-size: 1.15rem; }
.politique-content h3 { font-size: 1rem; }
.politique-content p { margin-bottom: .75rem; }
.politique-content ul { padding-left: 1.5rem; margin-bottom: .75rem; }
.politique-content li { margin-bottom: .25rem; }
.politique-content a { color: var(--primary); }
.politique-actions { text-align: right; margin-top: 1rem; }
.btn-print { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; background: var(--white); border: 0px solid var(--border); border-radius: var(--radius); font-size: .88rem; font-family: inherit; cursor: pointer; color: var(--text-muted); transition: all .12s; font-weight: 500; }
.btn-print:hover { border-color: var(--primary); color: var(--primary); }
.politique-footer { text-align: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--text-muted); }

/* --- Page: Exercer mes droits --- */

.form-public { max-width: 720px; margin: 2rem auto; }
.form-public fieldset { border: 0; border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; background: var(--white); }
.form-public legend { font-weight: 700; background: white; border-radius: 8px; margin-left: -20px; font-size: 1.1rem; padding: 0 .5rem 1rem 0.5rem; color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: .75rem; }
.form-group label { display: block; margin-bottom: .2rem; font-weight: 500; font-size: .9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: .5rem .7rem; border: 2px solid var(--border); border-radius: var(--radius); font-size: .95rem; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.12); }
.form-group input[type="file"] { padding: .4rem; }
.field-help { display: block; margin-top: .25rem; font-size: .78rem; color: var(--text-muted, #6c757d); }
.checkbox-label { display: flex; align-items: flex-start; gap: .5rem; font-size: .88rem; cursor: pointer; line-height: 1.4; }
.checkbox-label input { width: 25px; height: 25px; margin-top: 8px; margin-right: 8px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.checkbox-box { background: #f1f3f5; border: 2px dashed var(--border); border-radius: var(--radius); padding: .75rem 1.5rem; margin-top: .5rem; }
.info-legal { background: #e8f4fd; border-radius: var(--radius, 8px); padding: 1rem 1.25rem; margin: 1.5rem auto; }
.info-legal h3 { margin: 0 0 .4rem; font-size: .95rem; color: #0c5a97; }
.info-legal ul { margin: 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.6; }
.info-legal a { color: #0c5a97; }
.form-notice { display: flex; align-items: flex-start; gap: .5rem; background: #fff8e1; border-radius: var(--radius, 8px); padding: .75rem 1rem; font-size: .85rem; color: #7a5900; margin-bottom: .75rem; }
.form-notice i { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.captcha-row { display: flex; align-items: center; gap: 1.5rem; }
.captcha-display { background: #f1f3f5; border: 2px dashed var(--border); border-radius: var(--radius); padding: .75rem 1.5rem; }
.captcha-code { font-size: 1.5rem; font-weight: 800; letter-spacing: 6px; font-family: 'SF Mono', Consolas, monospace; color: var(--primary-dark); user-select: none; }
.form-actions { margin-top: 1.5rem; text-align: center; }
.form-note { margin-top: .75rem; font-size: .8rem; color: var(--text-muted); }

/* --- Page: Clôture demande --- */

.cloture-box { max-width: 520px; margin: 2rem auto; background: var(--white); border-radius: var(--radius); padding: 2rem; }
.cloture-box h2 { margin-bottom: .75rem; }
.warning-text { color: var(--text-muted); font-size: .85rem; margin: 1rem 0 .75rem; }
.error-text { color: var(--danger); margin-top: .75rem; font-size: .9rem; }
.token-form { display: flex; gap: .5rem; margin: 1rem 0; }
.token-form input { flex: 1; padding: .5rem .7rem; border: 0px solid var(--border); border-radius: var(--radius); font-size: .95rem; }

/* --- Page: Suivi demande --- */

.suivi-box { max-width: 560px; margin: 2rem auto; background: var(--white); border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow); }
.suivi-header { margin-bottom: 1rem; }
.suivi-status { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.2rem; border-radius: 50px; font-weight: 700; font-size: .95rem; }
.suivi-box h2 { margin: 0 0 1.25rem; font-size: 1.3rem; }
.suivi-details { text-align: left; margin-bottom: 1.25rem; }
.suivi-detail { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.suivi-detail:last-child { border-bottom: none; }
.suivi-label { font-weight: 600; color: var(--text-muted); }
.suivi-value code { background: #f1f3f5; padding: .15rem .4rem; border-radius: 4px; font-size: .82rem; }
.suivi-info { display: flex; align-items: flex-start; gap: .5rem; text-align: left; background: #e8f4fd; border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .88rem; color: #0c5a97; }
.suivi-info.suivi-success { background: #d1e7dd; border-color: #badbcc; color: #0f5132; }
.suivi-info.suivi-closed { background: #e9ecef; border-color: #dee2e6; color: #6c757d; }
.suivi-actions { display: flex; justify-content: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.suivi-footer { font-size: .78rem; color: var(--text-muted); margin: 0; }
.suivi-footer a { color: var(--primary); }

/* --- Page: 404 --- */

.not-found { text-align: center; padding: 2.5rem 1rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem; }
.not-found-icon { font-size: 3rem; margin-bottom: .5rem; }
.not-found h2 { font-size: 1.4rem; margin-bottom: .5rem; color: var(--cavac-dark); }
.not-found p { color: var(--text-muted); max-width: 500px; margin: 0 auto; line-height: 1.6; }
.not-found-actions { display: flex; justify-content: center; gap: .75rem; margin-top: 1.25rem; }

.policy-finder { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.policy-finder h3 { font-size: 1.1rem; margin: 0 0 .25rem; color: var(--cavac-dark); }
.policy-finder > p { color: var(--text-muted); font-size: .9rem; margin: 0 0 1rem; }
.site-search { margin-bottom: 1rem; }
.site-search input { width: 100%; padding: .6rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; font-family: inherit; }
.site-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58,125,68,.12); }
.site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .6rem; max-height: 420px; overflow-y: auto; }
.site-item { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); transition: all .12s; }
.site-item:hover { border-color: var(--primary); background: #f6faf6; text-decoration: none; }
.site-item-logo { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: #f8f9fa; border: 1px solid var(--border); padding: 2px; flex-shrink: 0; }
.site-item-initials { width: 34px; height: 34px; border-radius: 6px; background: var(--cavac-light, #e8f5e0); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; color: var(--primary-dark); flex-shrink: 0; }
.site-item-info { flex: 1; min-width: 0; }
.site-item-info strong { display: block; font-size: .88rem; line-height: 1.2; }
.site-item-info small { display: block; color: var(--text-muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-item-arrow { color: var(--primary); font-weight: 600; opacity: 0; transition: opacity .12s; }
.site-item:hover .site-item-arrow { opacity: 1; }

/* --- Responsive --- */

@media (max-width: 768px) {
	.home-grid { grid-template-columns: 1fr; }
	.rights-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
	.form-row { grid-template-columns: 1fr; }
	.captcha-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
	.rights-grid { grid-template-columns: 1fr; }
}

/* --- Print --- */

@media print {
	.header, .footer, .not-found-actions, .btn, .politique-actions { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.container { max-width: 100%; }
	.politique-content { border: none; padding: 0; box-shadow: none; }
}
