/* r4-brand: site branding. The colour tokens themselves come from the branding stylesheet the server writes into <head>. */

/* ---------- Logos in the header: the dark-theme logo replaces the light one ---------- */
.brand__logo { width: auto; max-width: 200px; object-fit: contain; }
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: inline-block; }

/* ---------- Sign-in pages: welcome text and side picture ---------- */
.authwelcome { font-size: 14px; color: var(--ink-2); margin: -8px 0 16px; white-space: pre-line; }
.authside { display: none; }
@media (min-width: 900px) {
    .login:has(.authside) { padding-left: calc(42vw + 20px); }
    .authside {
        display: block; position: fixed; inset: 0 auto 0 0; width: 42vw;
        background-color: var(--surface-3); background-size: cover; background-position: center;
    }
}

/* ---------- Public footer ---------- */
.brandfoot__address { white-space: pre-line; text-align: center; }
.brandfoot__social { display: inline-flex; flex-wrap: wrap; gap: 8px 14px; }

/* ---------- Admin branding page ---------- */
.brandpage__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
.brandpage__preview { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.brandpage .orgbrand { grid-template-columns: 1fr 1fr; align-items: start; }
.brandpage__files { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.brandpage__themes { border: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1100px) {
    .brandpage__grid { grid-template-columns: minmax(0, 1fr); }
    .brandpage__preview { position: static; }
}
@media (max-width: 720px) {
    .brandpage__files, .brandpage .orgbrand { grid-template-columns: minmax(0, 1fr); }
}

.brandfile { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.brandfile__row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brandfile__thumb {
    flex: none; width: 96px; height: 56px; display: grid; place-items: center; overflow: hidden;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.brandfile__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* The dark-theme logo is checked on a dark background, whatever the admin page's own theme. */
.brandfile__thumb--dark { background: #181a23; border-color: #2b2f3c; }
.brandfile__none { color: var(--muted); }
.brandfile__actions { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.brandfile__input { max-width: 100%; font-size: 12.5px; color: var(--ink-2); }
.brandfile__url { width: 100%; }
.brandfile__error { margin: 0; }

.brandlinks { border: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.brandfaq__row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; margin-top: 10px; }
.brandfaq__row .fld__textarea { grid-column: 1; }
.brandfaq__row .btn { grid-column: 2; grid-row: 1 / span 2; }
.brandlinks__row { display: flex; gap: 8px; width: 100%; align-items: center; }
.brandlinks__label { flex: 0 1 160px; min-width: 0; }
.brandlinks__url { flex: 1; min-width: 0; }
.brandpage .fld__input, .brandpage .fld__textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px;
    font-family: inherit; background: var(--surface); color: var(--ink); outline: none;
}
.brandpage .orgbrand__color .fld__input { flex: 1; min-width: 0; }

/* ---------- Live preview: each pane carries its own theme's surfaces and the edited brand tokens ---------- */
.brandprev__panes { display: flex; flex-direction: column; gap: 12px; }
.brandprev {
    --surface: #fff; --surface-3: #f3f3f8; --bg: #f5f5f9; --ink: #16161f; --ink-2: #374151; --muted: #5b6270; --line: #ececf1;
    background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
/* The dark pane copies the dark theme's surface tokens of app.css, so it shows the dark look on a light admin page too. */
.brandprev--dark { --surface: #181a23; --surface-3: #242733; --bg: #0f1117; --ink: #e9eaf1; --ink-2: #d0d3dc; --muted: #a1a6b4; --line: #2b2f3c; }
.brandprev__mode { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 14px 0; }
.brandprev__bar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 14px; }
.brandprev__bar .brand { font-size: 17px; }
.brandprev__body { padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.brandprev__tagline { font-weight: 700; color: var(--ink); }
.brandprev__text { font-size: 13.5px; color: var(--ink-2); }
.brandprev__row { display: flex; gap: 12px; align-items: center; }
.brandprev__chip { background: var(--tint-brand); color: var(--brand-ink); border: 1px solid var(--tint-brand-line); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.brandprev__link { color: var(--brand-ink); font-weight: 600; font-size: 13.5px; }
.brandprev .btn--solid:focus-visible { box-shadow: 0 0 0 4px var(--focus-ring); }

.brandcheck { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.brandcheck__h { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.brandcheck__list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.brandcheck__ok { color: var(--success-ink); }
.brandcheck__ok::before { content: "✓ "; }
.brandcheck__adjusted { color: var(--warn-ink); }
.brandcheck__adjusted::before { content: "↻ "; }
.brandcheck__warn { background: var(--tint-warn); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 9px; padding: 8px 10px; font-size: 13px; margin-bottom: 6px; }
.brandcheck__note { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
