/* Mon Avignon Alerte — reprend la charte des maquettes (bleu marine Ville d'Avignon). */
:root {
  --navy: #102b4c; --navy-dark: #09203a; --blue: #165c97; --light: #edf4f9; --border: #d7e1e9;
  --text: #243648; --muted: #52677a; --white: #fff; --focus: #f2bd48; --green: #18834b;
  --red: #a63a2e; --amber: #b57b24; --bg: #f5f7fa;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
[hidden] { display: none !important; }
h2 { color: var(--navy); font-size: 1.35rem; margin: 0 0 8px; }
h3 { color: var(--navy); font-size: 1.05rem; margin: 0 0 6px; }
a { color: var(--blue); text-underline-offset: 3px; }
.muted { color: var(--muted); } .small { font-size: .88rem; }

.header { background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top); }
.header-inner { max-width: 860px; margin: auto; padding: 26px 18px 22px; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; color: #c8e1f4; }
.header h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); margin: 4px 0 0; letter-spacing: -.03em; line-height: 1.1; }
.tagline { margin: 6px 0 0; color: #e2edf5; }

main { max-width: 860px; margin: 0 auto; padding: 22px 16px 110px; }
.loading { color: var(--muted); }
.intro { margin: 0 0 20px; } .intro p { margin: 0; color: var(--muted); }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 10px 30px rgba(15,46,75,.05); padding: 22px 18px; margin-bottom: 22px; }
.panel.compact { padding-top: 18px; }
.subtext { color: var(--muted); margin: 0 0 18px; font-size: .94rem; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-grid .field { margin-bottom: 0; }
.field.wide { grid-column: 1 / -1; }
label, .label { font-weight: 680; font-size: .94rem; }
input:not([type=checkbox]):not([type=file]), textarea {
  width: 100%; min-height: 48px; border: 1.5px solid #b9c9d7; border-radius: 7px; background: #fff;
  padding: 10px 13px; color: var(--navy); font: inherit; font-size: 16px;
}
textarea { resize: vertical; min-height: 110px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible, .file-btn:focus-within {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.helper { font-size: .84rem; color: var(--muted); }
.helper.ok { color: var(--green); font-weight: 600; }
.helper.warn { color: var(--amber); font-weight: 600; }

.address-field { position: relative; }
.suggestions { position: absolute; z-index: 20; top: 76px; left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px rgba(15,46,75,.16); max-height: 260px; overflow: auto; }
.suggestions li { padding: 10px 13px; cursor: pointer; font-size: .95rem; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--light); }

.privacy { margin: 20px 0 16px; background: var(--light); border-left: 4px solid var(--blue); padding: 14px 15px; border-radius: 4px; }
.privacy p { font-size: .88rem; margin: 0 0 12px; }
.checkrow { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkrow input { accent-color: var(--blue); width: 20px; height: 20px; flex: none; margin-top: 2px; }
.checkrow span { font-weight: 600; font-size: .92rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 4px; }
button, .file-btn {
  min-height: 48px; padding: 10px 22px; border: none; border-radius: 7px; background: var(--navy); color: #fff;
  font: inherit; font-weight: 720; cursor: pointer;
}
button:hover:not(:disabled) { background: var(--blue); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .file-btn { background: #eaf1f7; color: var(--navy); border: 1px solid #bfcedb; }
button.secondary:hover:not(:disabled), .file-btn:hover { background: #dde9f2; }
button.danger { background: var(--red); }
button.danger:hover:not(:disabled) { background: #872c22; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.inline-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.inline-row > * { flex: 1 1 180px; }

.notice { padding: 12px 15px; margin: 14px 0 0; border-radius: 7px; background: #e8f5ed; color: #164d33; border: 1px solid #b4dac5; }
.notice.error { background: #fbeceb; color: #7a241c; border-color: #eab8b2; }
.notice.warn { background: #fff7e9; color: #634618; border-color: #ecd3a6; }
.warning { border-left: 4px solid var(--amber); background: #fff7e9; color: #634618; padding: 12px 14px; border-radius: 5px; font-size: .9rem; margin: 10px 0 18px; }

.hello { margin: 0 0 16px; font-weight: 650; color: var(--navy); }
.tab-panel { background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 20px 17px; margin-bottom: 20px; }
.live-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; background: #eaf1f7; color: #164a74; border-radius: 30px; padding: 5px 10px; font-size: .74rem; font-weight: 800; }
.live-dot { width: 8px; height: 8px; background: #247c66; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.alert-list { margin: 10px 0 0; padding: 0; list-style: none; }
.alert-entry { padding: 14px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.alert-entry.recent .alert-title::after { content: 'NOUVEAU'; margin-left: 8px; font-size: .68rem; font-weight: 800; color: #fff; background: var(--red); border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
.alert-time { font-size: 1.05rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.alert-date { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.alert-title { font-weight: 780; color: var(--navy); margin: 0 0 3px; }
.alert-message { margin: 0; font-size: .95rem; white-space: pre-line; }
.alert-meta { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.empty { padding: 20px 0; color: var(--muted); border-top: 1px solid var(--border); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo-item { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.photo-item img { display: block; width: 100%; height: 96px; object-fit: cover; }
.photo-item button { position: absolute; top: 4px; right: 4px; min-height: 30px; padding: 2px 9px; font-size: .78rem; background: rgba(9,32,58,.85); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 18px; }
.details dt { color: var(--muted); font-size: .9rem; } .details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.danger-zone { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(15,46,75,.08); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button, .tabbar a {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 60px; padding: 6px 8px;
  border-radius: 0; background: #fff; color: var(--muted); font-weight: 700; font-size: .95rem; line-height: 1.25;
  border-top: 3px solid transparent; text-decoration: none;
}
.tabbar button:hover:not(:disabled), .tabbar a:hover { background: var(--light); color: var(--navy); }
.tabbar button[aria-current="page"] { color: var(--navy); border-top-color: var(--navy); }
h2[id] { scroll-margin-top: 90px; }

/* Sur ordinateur, dans le navigateur : le menu se place en haut, sous le bandeau. L'application
   installée sur un téléphone ou une tablette garde le menu en bas, à portée de pouce. */
@media (min-width: 900px) and (display-mode: browser) {
  main { padding-bottom: 40px; }
  .footer { padding-bottom: 20px; }
  .tabbar {
    position: sticky; top: 0; bottom: auto; margin: 0 0 20px; border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden; box-shadow: 0 6px 18px rgba(15,46,75,.07); padding-bottom: 0;
  }
  .tabbar button, .tabbar a { min-height: 50px; border-top: 0; border-bottom: 3px solid transparent; }
  .tabbar button[aria-current="page"] { border-bottom-color: var(--navy); }
}

.faq-section { margin-top: 10px; }
.accordion { display: grid; gap: 8px; }
.accordion details { background: #fff; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.accordion summary { list-style: none; cursor: pointer; position: relative; padding: 15px 46px 15px 17px; font-weight: 720; color: var(--navy); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--blue); }
.accordion details[open] summary::after { content: '−'; }
.accordion .answer { padding: 0 17px 16px; } .accordion .answer p { margin: 0 0 10px; }
.todo { background: #fff7e9; border: 1px dashed var(--amber); padding: 8px 10px; border-radius: 5px; font-size: .86rem; }
.footer { background: var(--navy-dark); color: #dce7ef; padding: 20px 16px 90px; text-align: center; font-size: .86rem; }
.footer strong { color: #fff; }

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .actions button { width: 100%; }
}

.pw-box { margin: 0 0 18px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.pw-box summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.pw-box form { margin-top: 12px; }
#login-form .helper { display: block; margin: 10px 0 4px; }
