/* ── Variables ── */
:root {
    --primary:        #4f46e5;
    --primary-hover:  #4338ca;
    --primary-light:  #ede9fe;
    --primary-border: #a5b4fc;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --border:         #e2e8f0;
    --bg:             #f5f3ff;
    --white:          #ffffff;
    --success-bg:     #ecfdf5;
    --success-text:   #065f46;
    --success-border: #6ee7b7;
    --error-bg:       #fef2f2;
    --error-text:     #991b1b;
    --error-border:   #fca5a5;
    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:      0 4px 12px rgba(0,0,0,.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Base ── */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ── */
.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ── */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .875rem 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
    letter-spacing: -.01em;
}

/* ── Main ── */
.site-main {
    flex: 1;
    padding: 2.5rem 0 3rem;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    text-align: center;
    font-size: .875rem;
    color: var(--text-muted);
}

/* ── Card ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .375rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: .9375rem;
}

/* ── Alert ── */
.alert {
    padding: .875rem 1.125rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    margin-bottom: 1.25rem;
    font-size: .9375rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: .9375rem;
    margin-bottom: .375rem;
    color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-hint {
    margin-top: .375rem;
    font-size: .8125rem;
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--white);
    text-decoration: none;
}

.btn-full { width: 100%; }

/* ── Campaign hero ── */
.campaign-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.25rem;
}

.campaign-hero h1 {
    font-size: 1.625rem;
    font-weight: 800;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
}

.campaign-hero p {
    opacity: .85;
    font-size: .9375rem;
}

/* ── Registration card ── */
.register-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.register-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* ── Questions (vote page) ── */
.vote-header {
    margin-bottom: 1.75rem;
}

.vote-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .25rem;
}

.vote-subtitle {
    color: var(--text-muted);
    font-size: .9375rem;
}

.question-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
}

.question-number {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 999px;
    margin-bottom: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.question-label {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .375rem;
}

.question-hint {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ── Choices ── */
.choices-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: .9375rem;
}

.choice-item:hover {
    border-color: var(--primary-border);
    background: var(--primary-light);
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.choice-item:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ── Submit area ── */
.vote-submit {
    margin-top: 1.75rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ── Thank you ── */
.thankyou-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.thankyou-icon {
    width: 72px;
    height: 72px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--success-text);
}

.thankyou-card h1 {
    font-size: 1.625rem;
    font-weight: 800;
    margin-bottom: .75rem;
}

.thankyou-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ── Campaign list (landing) ── */
.campaigns-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campaign-link-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    display: block;
}

.campaign-link-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.campaign-link-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.campaign-link-card p {
    font-size: .875rem;
    color: var(--text-muted);
}

.no-campaigns {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--white);
    border-radius: var(--radius);
}

/* ── Button variants ── */
.btn-sm {
    padding: .4375rem .875rem;
    font-size: .875rem;
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 1.5px solid var(--primary-border);
}

.btn-outline:hover {
    background: var(--primary-light);
    text-decoration: none;
}

/* ── Pouvoirs ── */
.pouvoir-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
    border: 1.5px solid var(--border);
}

.pouvoir-toggle-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    user-select: none;
}

.pouvoir-toggle-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.pouvoir-info {
    font-size: .875rem;
    color: var(--text-muted);
    margin: 1rem 0 .75rem;
}

.pouvoir-entry {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.pouvoir-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    flex: 1;
}

.pouvoir-input {
    margin: 0;
}

.btn-remove-pouvoir {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    width: 2rem;
    height: 2.375rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: border-color .15s, color .15s;
}

.btn-remove-pouvoir:hover {
    border-color: var(--error-border);
    color: var(--error-text);
}

.btn-remove-placeholder {
    width: 2rem;
    flex-shrink: 0;
}
