/* ============================================
   Branding Page — suite-kit overrides

   This page wears the unified suite kit (suite.css + editor-suite.css):
   <body class="tool-page suite">, fields are .s-field/.s-input/.s-select,
   sections are .s-fieldgroup, image tiles are .s-dropzone-tile, provinces
   are .s-chip, the save button is .s-btn-primary. Everything visual comes
   from those two stylesheets.

   What remains here is ONLY the handful of page-specific bits the kit
   doesn't ship: the narrower form column, the three-up upload grid, the
   province active-state (suite .s-chip uses an explicit .is-active class;
   here the chip wraps a checkbox so we drive the state off :checked), the
   compact colour-picker row, the font preview, and the save-status states.
   All values reference --s-* tokens — no --color-* / no new hues.
   ============================================ */

/* --- Page / form width --- */
/* .s-page is 1160px wide for the contacts table; the branding form reads
   better in a single narrower column. */
.branding-page.s-page { max-width: 760px; }
.branding-form-page { margin-top: 0.5rem; }

/* Small "optional" qualifier inside a field label. */
.field-optional {
    font-weight: 400;
    color: var(--s-text-3);
    font-size: 0.72rem;
    letter-spacing: 0;
    text-transform: none;
}

/* --- Logos & photos: three square upload tiles --- */
.upload-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
/* The placeholder (icon + label) stacks centred inside the square tile. */
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
/* Brokerage logos are usually wide rectangles; "contain" keeps them intact
   instead of cropping. (The headshot + logo tiles use the default cover.) */
#preview-brokerage-logo {
    object-fit: contain;
    padding: 8px;
    background: var(--s-surface);
}

/* --- Province chips ---
   suite .s-chip normally toggles an explicit .is-active class in JS; here the
   chip is a <label> wrapping a hidden checkbox (the data contract branding.js
   reads), so we hide the box and drive the active look off :checked. */
.province-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.province-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.province-chip:has(input:checked) {
    background: var(--s-accent);
    color: var(--s-on-accent);
}
.province-chip:has(input:focus-visible) {
    box-shadow: 0 0 0 3px var(--s-focus);
}

/* --- Brand colours: compact picker rows --- */
.colour-pickers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.colour-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.colour-input-row input[type="color"] {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--s-border-strong);
    border-radius: var(--s-r-md);
    cursor: pointer;
    padding: 2px;
    background: none;
}
/* The hex field is a .s-input but should stay compact beside the swatch
   rather than stretch full width. Monospace + uppercase reads as a code value. */
.colour-hex-input.s-input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--s-mono);
    text-transform: uppercase;
}

/* --- Style section --- */
.brand-style-desc {
    font-size: 0.86rem;
    color: var(--s-text-2);
    line-height: 1.55;
    margin: 0;
}

/* Font preview swatch under the Brand font select. */
.slide-font-select option {
    padding: 0.4rem;
    font-size: 1rem;
}
.slide-font-preview {
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--s-surface-2);
    border: 1px solid var(--s-border);
    border-radius: var(--s-r-md);
    font-size: 1.15rem;
    color: var(--s-text);
    font-weight: 500;
    transition: font-family var(--s-t-fast);
}

/* --- Save action row --- */
.branding-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--s-border);
    flex-wrap: wrap;
}
.btn-save.saving { opacity: 0.6; cursor: wait; }

.save-status {
    font-size: 0.82rem;
    color: var(--s-text-3);
    transition: opacity var(--s-t);
    /* Longer informational warnings wrap cleanly beside the Save button. */
    max-width: 56ch;
    line-height: 1.4;
}
.save-status.success { color: var(--s-ok); }
.save-status.error { color: var(--s-danger); }
.save-status.warning { color: var(--s-warn); }

/* --- Responsive --- */
@media (max-width: 700px) {
    .colour-pickers { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .upload-row { grid-template-columns: 1fr 1fr; }
}
