/* =====================================================================
   iOS 26 branding sheet — Settings → Appearance → Branding
   (app/Views/settings/branding.php, scoped to .nz-brand26)
   ---------------------------------------------------------------------
   Sections of inset grouped rows, the two logos as tiles with their own
   light / dark stage, and two iPad mockups that repaint live from what
   was picked (logo, dark logo, favicon, title) before anything is saved.
   Colours come from the --ios26-* tokens (assets/css/ios26-tokens.css),
   which already carry the dark values under body.color-1E202D. The
   mockups themselves are pictures of a light and a dark workspace, so
   their colours are fixed on purpose and do not follow the theme.
   ===================================================================== */

.nz-brand26 {
    --nz-brand-cell: #fff;
    --nz-brand-stage-light: #ffffff;
    --nz-brand-stage-dark: #1E202D;
    --nz-brand-warn: #a35400;
    padding: 24px;
    color: var(--ios26-text);
}

body.color-1E202D .nz-brand26 {
    --nz-brand-cell: rgba(255, 255, 255, .035);
    --nz-brand-warn: #ffb340;
}

/* ---------- sections ---------- */

.nz-brand26 .nz-brand-sec + .nz-brand-sec {
    margin-top: 30px;
}

.nz-brand26 .nz-brand-sec-head {
    margin: 0 4px 12px;
}

.nz-brand26 .nz-brand-sec-head h2 {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ios26-text);
}

.nz-brand26 .nz-brand-sec-head p,
.nz-brand26 .nz-brand-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ios26-muted);
}

/* ---------- logo tiles ---------- */

.nz-brand26 .nz-brand-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.nz-brand26 .nz-brand-slot {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ios26-hairline-strong);
    border-radius: var(--ios26-radius-lg);
    background: var(--nz-brand-cell);
    overflow: hidden;
}

.nz-brand26 .nz-brand-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 112px;
    padding: 16px;
    border-bottom: 1px solid var(--ios26-hairline);
}

.nz-brand26 .nz-brand-stage.is-light {
    background: var(--nz-brand-stage-light);
}

.nz-brand26 .nz-brand-stage.is-dark {
    background: var(--nz-brand-stage-dark);
    border-bottom-color: rgba(255, 255, 255, .06);
}

.nz-brand26 .nz-brand-stage img {
    display: block;
    width: auto;
    max-width: min(175px, 100%);
    max-height: 48px;
    object-fit: contain;
}

/* the favicon stage carries its own light + dark chips, so it stays on the cell */
.nz-brand26 .nz-brand-stage.is-neutral {
    background: var(--ios26-fill);
}

/* the light logo shown as a stand-in on the dark stage */
.nz-brand26 .nz-brand-stage img.is-fallback {
    opacity: .55;
}

.nz-brand26 .nz-brand-stage-tag {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #6e6e73;
}

.nz-brand26 .nz-brand-stage.is-dark .nz-brand-stage-tag {
    color: #aeb4cc;
}

.nz-brand26 .nz-brand-pending {
    position: absolute;
    top: 8px;
    right: 10px;
    display: none;
    padding: 2px 8px;
    border-radius: var(--ios26-pill);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--ios26-accent);
}

.nz-brand26 .is-pending .nz-brand-pending {
    display: inline-block;
}

.nz-brand26 .nz-brand-slot-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
}

.nz-brand26 .nz-brand-slot-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ios26-text);
}

.nz-brand26 .nz-brand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.nz-brand26 .nz-brand-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

/* the crop button wraps its own transparent file input */
.nz-brand26 .nz-brand-actions .file-upload {
    position: relative;
    overflow: hidden;
}

/* favicon: one wide row under the logos */
.nz-brand26 .nz-brand-slot.is-wide {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
}

.nz-brand26 .nz-brand-slot.is-wide .nz-brand-stage {
    flex: 0 0 168px;
    height: auto;
    min-height: 112px;
    border-bottom: 0;
    border-right: 1px solid var(--ios26-hairline);
    gap: 14px;
}

.nz-brand26 .nz-brand-fav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

.nz-brand26 .nz-brand-fav.is-light {
    background: #f2f2f7;
}

.nz-brand26 .nz-brand-fav.is-dark {
    background: #1E202D;
}

.nz-brand26 .nz-brand-fav img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ---------- iPad mockups ---------- */

.nz-brand26 .nz-brand-mocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.nz-brand26 .nz-mock {
    margin: 0;
}

.nz-brand26 .nz-mock-device {
    padding: 9px;
    border-radius: 26px;
    background: #1c1c1e;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, var(--ios26-shadow-1);
}

.nz-brand26 .nz-mock-screen {
    --m-canvas: #f2f2f7;
    --m-bar: #e9e9ee;
    --m-tab: #ffffff;
    --m-side: rgba(255, 255, 255, .86);
    --m-card: #ffffff;
    --m-ink: #1d1d1f;
    --m-line: rgba(17, 24, 39, .10);
    --m-skel: rgba(17, 24, 39, .09);
    --m-accent: #6690F4;
    display: flex;
    flex-direction: column;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 18px;
    background: var(--m-canvas);
    color: var(--m-ink);
    font-size: 10px;
    line-height: 1.2;
}

.nz-brand26 .nz-mock.is-dark .nz-mock-screen {
    --m-canvas: #16171f;
    --m-bar: #23252f;
    --m-tab: #2f323e;
    --m-side: #1E202D;
    --m-card: #262936;
    --m-ink: #eef0f6;
    --m-line: rgba(255, 255, 255, .08);
    --m-skel: rgba(255, 255, 255, .10);
    --m-accent: #5b73e8;
}

/* Safari tab bar: favicon + workspace name */
.nz-brand26 .nz-mock-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 10px;
    background: var(--m-bar);
    border-bottom: 1px solid var(--m-line);
}

.nz-brand26 .nz-mock-dots {
    display: flex;
    gap: 3px;
    flex: 0 0 auto;
}

.nz-brand26 .nz-mock-dots i {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--m-skel);
}

.nz-brand26 .nz-mock-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 62%;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--m-tab);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.nz-brand26 .nz-mock-tab img {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.nz-brand26 .nz-mock-tab span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
}

.nz-brand26 .nz-mock-app {
    display: flex;
    flex: 1;
    min-height: 0;
}

.nz-brand26 .nz-mock-side {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 0 0 27%;
    padding: 10px 8px;
    background: var(--m-side);
    border-right: 1px solid var(--m-line);
}

.nz-brand26 .nz-mock-logo {
    display: flex;
    align-items: center;
    height: 26px;
    margin: 0 2px 6px;
}

.nz-brand26 .nz-mock-logo img {
    display: block;
    max-width: 100%;
    max-height: 22px;
    object-fit: contain;
}

.nz-brand26 .nz-mock-item {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 13px;
    padding: 0 4px;
    border-radius: 5px;
}

.nz-brand26 .nz-mock-item::before {
    content: "";
    flex: 0 0 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--m-skel);
}

.nz-brand26 .nz-mock-item::after {
    content: "";
    flex: 0 1 var(--w, 60%);
    height: 4px;
    border-radius: 2px;
    background: var(--m-skel);
}

.nz-brand26 .nz-mock-item.is-active {
    background: var(--m-accent);
}

.nz-brand26 .nz-mock-item.is-active::before,
.nz-brand26 .nz-mock-item.is-active::after {
    background: rgba(255, 255, 255, .85);
}

.nz-brand26 .nz-mock-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 10px;
}

.nz-brand26 .nz-mock-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nz-brand26 .nz-mock-h {
    width: 38%;
    height: 7px;
    border-radius: 3px;
    background: var(--m-ink);
    opacity: .75;
}

.nz-brand26 .nz-mock-avatar {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--m-accent);
    opacity: .8;
}

.nz-brand26 .nz-mock-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.nz-brand26 .nz-mock-tiles span,
.nz-brand26 .nz-mock-list {
    border-radius: 7px;
    background: var(--m-card);
    border: 1px solid var(--m-line);
}

.nz-brand26 .nz-mock-tiles span {
    height: 30px;
    position: relative;
}

.nz-brand26 .nz-mock-tiles span::after {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 6px;
    width: 45%;
    height: 6px;
    border-radius: 2px;
    background: var(--m-skel);
}

.nz-brand26 .nz-mock-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 4px 8px;
}

.nz-brand26 .nz-mock-list i {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: var(--m-skel);
}

.nz-brand26 .nz-mock-list i:nth-child(2n) {
    width: 70%;
}

.nz-brand26 .nz-mock figcaption,
.nz-brand26 .nz-mock-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios26-text);
}

.nz-brand26 .nz-mock-default {
    display: none;
    padding: 1px 8px;
    border-radius: var(--ios26-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--ios26-accent-strong);
    background: var(--ios26-accent-soft);
}

body.color-1E202D .nz-brand26 .nz-mock-default {
    color: #c9d2ff;
}

.nz-brand26 .nz-mock.is-default .nz-mock-default {
    display: inline-block;
}

.nz-brand26 .nz-mock-fallback {
    display: none;
    margin-top: 2px;
    text-align: center;
    font-size: 12px;
    color: var(--ios26-muted);
}

.nz-brand26 .nz-mock.uses-fallback .nz-mock-fallback {
    display: block;
}

/* ---------- inset grouped rows ---------- */

.nz-brand26 .nz-brand-list {
    border: 1px solid var(--ios26-hairline-strong);
    border-radius: var(--ios26-radius-lg);
    background: var(--nz-brand-cell);
    overflow: hidden;
}

.nz-brand26 .nz-brand-row {
    display: grid;
    grid-template-columns: minmax(180px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 8px 20px;
    margin: 0;
    padding: 14px 16px;
}

.nz-brand26 .nz-brand-row + .nz-brand-row {
    border-top: 1px solid var(--ios26-hairline);
}

.nz-brand26 .nz-brand-row-label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ios26-text);
}

.nz-brand26 .nz-brand-row-label small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--ios26-muted);
}

.nz-brand26 .nz-brand-row .form-control {
    border-radius: var(--ios26-radius-sm);
}

/* jquery-validate puts its message right after the input */
.nz-brand26 .nz-brand-row .error:not(.form-control) {
    display: block;
    margin-top: 4px;
}

/* switch row: label left, switch pinned right */
.nz-brand26 .nz-brand-row.is-switch {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.nz-brand26 .nz-brand-row.is-switch .form-check {
    margin: 0;
    padding-left: 0;
    min-height: 0;
}

.nz-brand26 .nz-brand-row.is-switch .form-check-input {
    float: none;
    width: 46px;
    height: 26px;
    margin: 0;
    cursor: pointer;
}

/* tiny sign-in card next to the switch */
.nz-brand26 .nz-signin-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 92px;
    padding: 8px 9px;
    border: 1px solid var(--ios26-hairline-strong);
    border-radius: 10px;
    background: #fff;
}

body.color-1E202D .nz-brand26 .nz-signin-mini {
    background: #262936;
}

.nz-brand26 .nz-signin-mini img {
    max-width: 66px;
    max-height: 14px;
    object-fit: contain;
}

.nz-brand26 .nz-signin-mini.no-logo img {
    visibility: hidden;
}

.nz-brand26 .nz-signin-mini i {
    display: block;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--ios26-fill-hover);
}

.nz-brand26 .nz-signin-mini i.is-btn {
    background: var(--ios26-accent);
}

/* ---------- default appearance: two choice cards ---------- */

.nz-brand26 .nz-brand-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.nz-brand26 .nz-brand-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--ios26-hairline-strong);
    border-radius: var(--ios26-radius-lg);
    background: var(--nz-brand-cell);
    cursor: pointer;
    transition: border-color .2s var(--ios26-ease), box-shadow .2s var(--ios26-ease);
}

.nz-brand26 .nz-brand-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nz-brand26 .nz-brand-choice:has(input:checked) {
    border-color: var(--ios26-accent);
    box-shadow: 0 0 0 3px var(--ios26-accent-ring);
}

.nz-brand26 .nz-brand-choice:has(input:focus-visible) {
    outline: 2px solid var(--ios26-accent);
    outline-offset: 2px;
}

.nz-brand26 .nz-brand-swatch {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 30% 1fr;
    width: 64px;
    height: 46px;
    overflow: hidden;
    border-radius: 9px;
    border: 1px solid var(--ios26-hairline-strong);
}

.nz-brand26 .nz-brand-swatch.is-light {
    background: #f2f2f7;
}

.nz-brand26 .nz-brand-swatch.is-light::before {
    content: "";
    background: #fff;
    border-right: 1px solid rgba(17, 24, 39, .08);
}

.nz-brand26 .nz-brand-swatch.is-dark {
    background: #16171f;
}

.nz-brand26 .nz-brand-swatch.is-dark::before {
    content: "";
    background: #1E202D;
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.nz-brand26 .nz-brand-choice-text {
    flex: 1;
    min-width: 0;
}

.nz-brand26 .nz-brand-choice-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ios26-text);
}

.nz-brand26 .nz-brand-choice-text small {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ios26-muted);
}

.nz-brand26 .nz-brand-check {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--ios26-hairline-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
}

.nz-brand26 .nz-brand-choice:has(input:checked) .nz-brand-check {
    border-color: var(--ios26-accent);
    background: var(--ios26-accent);
    color: #fff;
}

/* ---------- footer ---------- */

.nz-brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.nz-brand-footer .nz-brand-unsaved {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--nz-brand-warn, #a35400);
}

body.color-1E202D .nz-brand-footer .nz-brand-unsaved {
    color: #ffb340;
}

.nz-brand-footer.is-dirty .nz-brand-unsaved {
    display: inline-block;
}

.nz-brand-footer .btn {
    border-radius: var(--ios26-pill);
    padding-left: 18px;
    padding-right: 18px;
}

/* ---------- iPad portrait and narrower ---------- */

@media (max-width: 991.98px) {
    .nz-brand26 .nz-brand-row {
        grid-template-columns: minmax(150px, 38%) minmax(0, 1fr);
    }
}

/* ---------- phone ---------- */

@media (max-width: 767.98px) {
    .nz-brand26 {
        padding: 16px;
    }

    .nz-brand26 .nz-brand-slots,
    .nz-brand26 .nz-brand-mocks,
    .nz-brand26 .nz-brand-choices {
        grid-template-columns: minmax(0, 1fr);
    }

    .nz-brand26 .nz-brand-slot.is-wide {
        flex-direction: column;
    }

    .nz-brand26 .nz-brand-slot.is-wide .nz-brand-stage {
        flex-basis: auto;
        border-right: 0;
        border-bottom: 1px solid var(--ios26-hairline);
    }

    /* one full-width button per line: a translated label never wraps inside the button */
    .nz-brand26 .nz-brand-actions .btn {
        flex: 1 1 100%;
        white-space: nowrap;
    }

    .nz-brand26 .nz-brand-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .nz-brand26 .nz-brand-row .form-control {
        min-height: 44px;
        font-size: 16px; /* no iOS zoom on focus */
    }

    .nz-brand26 .nz-brand-row.is-switch {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nz-brand26 .nz-signin-mini {
        display: none;
    }

    .nz-brand-footer .btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}
