/* ── Variables ── */
:root {
    --gold: #B8960C;
    --dark: #2C2C2A;
    --purple-light: #EEEDFE;
    --purple-mid: #AFA9EC;
    --purple-dark: #3C3489;
    --text: #1a1a1a;
    --text-muted: #666;
    --border: #e0ddd8;
    --radius: 8px;
    --radius-lg: 12px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: #F5F3EE;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.site-header {
    background: var(--dark);
    color: white;
    padding: 14px 0;
    border-bottom: 1px solid #444;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
    height: 60px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}
.brand-loge {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.brand-orient { display: block; font-size: 12px; color: #aaa; }

/* ── Main ── */
.main-content { flex: 1; padding: 2rem 0; }

/* ── Footer ── */
.site-footer {
    background: var(--dark);
    color: #777;
    text-align: center;
    font-size: 12px;
    padding: 12px 0;
    margin-top: auto;
}

/* ── Alertes ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 14px;
}
.alert-success { background: #eafaf1; border: 1px solid #a7e3bc; color: #1a6035; }
.alert-danger  { background: #fdf3f3; border: 1px solid #f5b7b7; color: #891515; }
.error-list { padding-left: 1.2em; }
.error-list li { margin-bottom: 2px; }

/* ── Page titre ── */
.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Formulaire d'inscription ── */
.form-page { max-width: 700px; }
.form-intro { margin-bottom: 1.5rem; }

.form-section {
    border: none;
    background: white;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--border);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.form-section legend {
    font-family: 'Cormorant Garamond', serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--dark);
    padding: 0 6px;
}
.legend-hint { font-size: 11px; font-family: 'Jost', sans-serif; color: var(--text-muted); text-transform: none; font-weight: 400; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.req { color: #c0392b; }

.form-group input,
.form-group select {
    padding: 9px 12px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #fafaf8;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--purple-dark);
    box-shadow: 0 0 0 3px rgba(60,52,137,.08);
    background: white;
}
.form-group.has-error input,
.form-group.has-error select { border-color: #e74c3c; }
.error-msg { font-size: 12px; color: #c0392b; }

/* Photo upload */
.photo-upload-label { cursor: pointer; display: block; }
.photo-preview {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: background .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.photo-preview:hover { background: #f5f3ee; }
.photo-hint { font-size: 11px; }

/* Compétences */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 6px;
    margin-top: 1rem;
}
.comp-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all .12s;
    background: #fafaf8;
    user-select: none;
}
.comp-item input { display: none; }
.comp-item:hover { background: var(--purple-light); border-color: var(--purple-mid); }
.comp-item.checked {
    background: var(--purple-light);
    border-color: var(--purple-dark);
    color: var(--purple-dark);
    font-weight: 500;
}
.comp-item.checked::before { content: "✓ "; font-weight: 700; }

/* Submit */
.form-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.confidential-note { font-size: 12px; color: var(--text-muted); }

.btn-primary {
    background: var(--dark); color: white;
    border: none; padding: 11px 28px;
    border-radius: var(--radius);
    font-family: 'Jost', sans-serif;
    font-size: 14px; font-weight: 500;
    cursor: pointer; transition: opacity .15s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-outline {
    display: inline-block;
    border: 1px solid var(--dark);
    color: var(--dark);
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background .15s;
}
.btn-outline:hover { background: var(--dark); color: white; }

/* ── Merci ── */
.merci-page {
    max-width: 500px;
    text-align: center;
    margin: 3rem auto;
}
.merci-icon {
    font-size: 40px;
    color: var(--gold);
    margin-bottom: 1rem;
    font-family: 'Cormorant Garamond', serif;
}
.merci-page h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    margin-bottom: 1rem;
}
.merci-sub { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ── Login ── */
.login-page { max-width: 420px; margin: 2rem auto; }
.login-card {
    background: white;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-symbol {
    font-size: 32px;
    color: var(--gold);
    display: block;
    font-family: 'Cormorant Garamond', serif;
}
.login-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    margin-top: 6px;
}
.login-header p { font-size: 13px; color: var(--text-muted); }
.login-form .form-group { margin-bottom: 12px; }
.remember-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; }

/* ── Admin bar ── */
.admin-bar {
    background: var(--dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
}
.admin-bar-left { display: flex; align-items: center; gap: 10px; }
.admin-badge {
    background: var(--gold);
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.admin-name { font-size: 13px; }
.btn-logout {
    background: none;
    border: 0.5px solid rgba(255,255,255,.3);
    color: white;
    padding: 5px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: background .15s;
    margin-right: 10px;
}
.btn-logout:hover { background: rgba(255,255,255,.1); }

/* ── Répertoire admin ── */
.repertoire-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-pdf {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--dark); color: white;
    padding: 9px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    transition: opacity .15s;
}
.btn-pdf:hover { opacity: 0.85; }

.search-form {
    display: flex; gap: 8px; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-form input {
    flex: 1; min-width: 200px;
    padding: 9px 12px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    background: white;
}
.search-form input:focus { outline: none; border-color: var(--purple-dark); }
.btn-search {
    padding: 9px 18px;
    background: var(--dark); color: white; border: none;
    border-radius: var(--radius); font-size: 14px;
    font-family: 'Jost', sans-serif; cursor: pointer;
}
.btn-reset {
    padding: 9px 14px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    text-decoration: none;
    color: var(--text-muted);
    background: white;
}

/* ── Cartes des Frères ── */
.freres-list { display: flex; flex-direction: column; gap: 10px; }
.frere-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: white;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    position: relative;
}
.frere-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 0.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    background: var(--purple-light);
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--purple-dark);
}
.frere-avatar img { width: 52px; height: 52px; object-fit: cover; }
.frere-info { flex: 1; min-width: 0; }
.frere-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-weight: 600;
}
.frere-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.frere-contacts { font-size: 13px; color: var(--text); margin-top: 3px; }
.frere-comps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.comp-badge {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--purple-light);
    color: var(--purple-dark);
    border: 0.5px solid var(--purple-mid);
}
.frere-actions {
    position: absolute; top: 10px; right: 12px;
}
.btn-delete {
    background: none; border: none;
    color: #ccc; cursor: pointer;
    font-size: 16px; padding: 4px;
    transition: color .15s;
}
.btn-delete:hover { color: #e74c3c; }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: white;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--border);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }

/* ── Print ── */
@media print {
    .no-print { display: none !important; }
    .frere-card { break-inside: avoid; page-break-inside: avoid; }
    body { background: white; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .comp-grid { grid-template-columns: 1fr 1fr; }
    .form-footer { flex-direction: column; align-items: stretch; }
    .btn-primary { width: 100%; text-align: center; }
    .repertoire-header { flex-direction: column; }
}
