/* ==========================================================================
   lcdf27 — account pages
   Visual language taken from the lcdf27.ch homepage: white canvas, hairlines,
   lowercase headings, black pill buttons, grey panels, blue/red accents.
   ========================================================================== */

:root {
    --ink: #000;
    --paper: #fff;
    --line: #c9c9c9;
    --muted: #6e6e6e;
    --panel: #ebebeb;
    --blue: #00a9e6;
    --red: #e5452b;

    --font: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    --gutter: 16px;
    --content: 560px;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font: 400 1rem/1.45 var(--font);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top, 0px);
}

a { color: inherit; }

p { margin: 0 0 1em; }

strong { font-weight: 500; }

[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header ---------- */

.lang-switch {
    position: absolute;
    top: 12px;
    right: var(--gutter);
    display: flex;
    padding: 4px 8px 4px 16px;
    font-size: .8125rem;
    font-weight: 500;
    background: var(--paper);
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lang-switch a {
    position: relative;
    text-decoration: none;
    color: var(--muted);
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current] { color: var(--ink); }
.lang-switch a[aria-current]::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2px;
    border-radius: 50%;
    background: currentColor;
}

.hero {
    position: relative;
    height: clamp(140px, 20vw, 200px);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero__logo {
    position: absolute;
    display: block;
    line-height: 0;
    top: 50%;
    left: 50%;
    width: clamp(88px, 14vw, 128px);
    height: auto;
    transform: translate(-50%, -50%);
}
.hero__logo img { width: 100%; height: auto; }

/* ---------- Main ---------- */

.main {
    flex: 1;
    width: 100%;
    max-width: calc(var(--content) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 40px var(--gutter) 56px;
}

.title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 7vw, 2.75rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.02em;
}

.lead {
    margin: 0 0 32px;
    font-size: 1.0625rem;
    color: var(--muted);
}

/* ---------- Notices (flash messages, errors) ---------- */

.notice {
    position: relative;
    margin: 0 0 24px;
    padding: 14px 18px 14px 34px;
    font-weight: 500;
}
.notice::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 21px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.notice a { font-weight: 500; }

.notice--success { background: var(--blue); color: var(--ink); }
.notice--error { background: var(--paper); color: var(--red); border: 1px solid var(--red); }
.notice--info { background: var(--panel); color: var(--ink); }

/* ---------- Panel (grey block, like "les cartes blanches") ---------- */

.panel {
    margin: 0 0 32px;
    padding: 24px 22px;
    background: var(--panel);
}
.panel > :last-child { margin-bottom: 0; }
.account-email h2 {
    margin: 0 0 4px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--muted);
}
.account-email p {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; }

.field { margin: 0 0 24px; }

.field__label {
    display: block;
    margin: 0 0 4px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--muted);
}

.field input[type='email'],
.field input[type='password'],
.field input[type='text'],
.field input[type='number'] {
    width: 100%;
    height: 52px;
    padding: 0;
    font: 500 1.25rem/1 var(--font);
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { box-shadow: 0 1px 0 0 var(--ink); }

.field__help {
    margin: 8px 0 0;
    font-size: .8125rem;
    color: var(--muted);
}

.field-errors {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
    font-weight: 500;
    color: var(--red);
}
.field-errors li + li { margin-top: 2px; }

.field--error input[type='email'],
.field--error input[type='password'],
.field--error input[type='text'],
.field--error input[type='number'] { border-bottom-color: var(--red); }

.form > .field-errors { margin: 0 0 24px; }

.field--checkbox {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 12px;
    align-items: start;
}
.field--checkbox label { font-size: .9375rem; }
.field--checkbox .field-errors { grid-column: 2; }

.field input[type='checkbox'] {
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.field input[type='checkbox']:checked {
    background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.field input[type='checkbox']:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 26px;
    font: 500 1.125rem/1 var(--font);
    text-decoration: none;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover { background: #262626; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--outline { color: var(--ink); background: transparent; }
.btn--outline:hover { color: var(--paper); background: var(--ink); }

.btn:disabled,
.btn:disabled:hover {
    color: var(--muted);
    background: transparent;
    border-color: var(--line);
    cursor: default;
    transform: none;
}

.form .btn { align-self: flex-start; margin-top: 8px; }

/* ---------- Secondary links ---------- */

.links {
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
}
.links li { border-bottom: 1px solid var(--line); }
.links li:first-child { border-top: 1px solid var(--line); }
.links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
}
.links a::after { content: '→'; transition: transform .15s ease; }
.links a:hover::after { transform: translateX(4px); }
.links__hint { color: var(--muted); font-weight: 400; }

.muted { color: var(--muted); }

/* ---------- Footer (black band, like the homepage) ---------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
    font-size: .8125rem;
    font-weight: 500;
    color: var(--paper);
    background: var(--ink);
}
.site-footer__tagline { position: relative; padding-left: 12px; }
.site-footer__tagline::before {
    content: '';
    position: absolute;
    left: 0;
    top: .5em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.site-footer__copy { color: #9a9a9a; }

/* ---------- Larger screens ---------- */

@media (min-width: 768px) {
    :root { --gutter: 32px; }
    .main { padding-top: 64px; padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ==========================================================================
   Admin
   ========================================================================== */

.main--wide { max-width: calc(880px + 2 * var(--gutter)); }

.admin-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    margin: -16px 0 40px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    font-size: .875rem;
    font-weight: 500;
}
.admin-bar a { text-decoration: none; }
.admin-bar a:hover { text-decoration: underline; }
.admin-bar__home { position: relative; padding-left: 12px; }
.admin-bar__home::before {
    content: '';
    position: absolute;
    left: 0;
    top: .5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
}
.admin-bar__user { display: flex; flex-wrap: wrap; gap: 4px 16px; }

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.page-head .title { margin: 0; }

/* ---------- News list ---------- */

.news-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.news { padding: 22px 0; border-bottom: 1px solid var(--line); }

.news__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    font-size: .8125rem;
    color: var(--muted);
}

.news__title {
    margin: 6px 0 6px;
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.news__body { margin: 0 0 14px; color: var(--muted); white-space: pre-line; }

.news__actions {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    font-size: .9375rem;
    font-weight: 500;
}
.news__actions form { margin: 0; }

.link-button {
    padding: 0;
    font: inherit;
    color: var(--red);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
    padding: 4px 12px;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid var(--ink);
    border-radius: 999px;
}
.chip--all { background: var(--panel); border-color: var(--panel); }
.chip--push { background: var(--blue); border-color: var(--blue); }
.chip--muted { color: var(--muted); border-color: var(--line); }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    font-weight: 500;
}
.pager a { text-decoration: none; }

/* ---------- Notification form ---------- */

.form--wide { max-width: 680px; }

.field textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    font: 400 1.0625rem/1.45 var(--font);
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 0;
    outline: none;
    resize: vertical;
}
.field textarea:focus { box-shadow: 0 0 0 1px var(--ink); }
.field--error textarea { border-color: var(--red); }

.field__counter {
    display: block;
    margin-top: 6px;
    font-size: .75rem;
    color: var(--muted);
    text-align: right;
}

fieldset.field { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
fieldset.field > legend { padding: 0; }
fieldset.field > .field__help { margin: 0 0 12px; }

.event-picker__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 8px;
}
.event-picker__tools input[type='search'] {
    flex: 1 1 260px;
    height: 44px;
    padding: 0;
    font: 500 1rem/1 var(--font);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.event-picker__tools span { font-size: .8125rem; }

.event-picker__list {
    max-height: 340px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--line);
}
.event-picker__list li {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.event-picker__list li:last-child { border-bottom: 0; }
.event-picker__list li:has(input:checked) { background: var(--panel); }
.event-picker__list label { display: flex; flex-direction: column; cursor: pointer; }
.event-picker__list .muted { font-size: .8125rem; }
.event-picker__title { font-weight: 500; }

.event-picker input[type='checkbox'],
.event-picker__list input[type='checkbox'] {
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.event-picker__list input[type='checkbox']:checked {
    background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.field--checkbox .field__help { grid-column: 2; margin-top: 4px; }

.form__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.form .form__actions .btn { margin-top: 0; }

/* ---------- Events sync status ---------- */

.sync-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin: 0 0 24px;
    font-size: .8125rem;
}
fieldset.field .sync-status { margin-bottom: 12px; }

.link-button--ink { color: var(--ink); font-weight: 500; }
.link-button:disabled { color: var(--muted); cursor: progress; }
.sync-status .is-error { color: var(--red); }
