/* Isolated reseller overrides, loaded after final QA. Product defaults stay unchanged. */
html[data-reseller-theme] {
    --fm-border-red: var(--fm-red-2);
    --fm-red-soft: rgba(var(--fm-red-rgb), .16);
    --fm-glow: 0 12px 32px rgba(0,0,0,.25);
}
html[data-reseller-theme] body:not(.fm-account-page),
html[data-reseller-theme] .content-wrapper {
    background: var(--fm-bg, #0b1017) !important;
}
html[data-reseller-theme] .btn-primary,
html[data-reseller-theme] .btn-fm-primary,
html[data-reseller-theme] .btn-outline-primary,
html[data-reseller-theme] .content-wrapper button[type="submit"]:not(.btn-outline-secondary):not(.btn-secondary),
html[data-reseller-theme] .nav-sidebar .nav-link.active,
html[data-reseller-theme] .ai-credit-nav-pill {
    background: var(--fm-red) !important;
    color: var(--fm-brand-foreground) !important;
    border: 1px solid var(--fm-red-2) !important;
    box-shadow: none !important;
}
html[data-reseller-theme] .btn-primary:hover,
html[data-reseller-theme] .btn-outline-primary:hover,
html[data-reseller-theme] .btn-fm-primary:hover {
    background: var(--fm-red) !important;
    color: var(--fm-brand-foreground) !important;
    outline: 2px solid var(--fm-red-2);
    outline-offset: 2px;
}
html[data-reseller-theme] a:not(.btn):not(.nav-link):not(.brand-link):not(.dropdown-item) { color: var(--fm-red-2); }
html[data-reseller-theme] .fm-sidebar-brand { border-bottom: 2px solid var(--fm-red-2); }
html[data-reseller-theme] .nav-sidebar .nav-link.active { border-left-width: 4px !important; }
html[data-reseller-theme] .btn-outline-secondary:hover,
html[data-reseller-theme] .btn-secondary:hover { background:rgba(255,255,255,.1) !important; border-color:var(--fm-red-2) !important; }
html[data-reseller-theme] .content-wrapper .alert-info { background:#18222e !important; border:1px solid #526174 !important; border-left:3px solid var(--fm-red-2) !important; }
html[data-reseller-theme] .content-wrapper code { color:var(--fm-red-2) !important; background:#111923 !important; border-color:#526174 !important; }
.fm-brand-initial { display:inline-flex; width:36px; height:36px; align-items:center; justify-content:center; border:1px solid var(--fm-red-2); border-radius:8px; margin-right:.65rem; color:var(--fm-text); }
.fm-brand-editor .card-body { padding:clamp(1rem,2vw,1.6rem); }
.fm-brand-editor-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:2rem; align-items:start; }
.fm-brand-fields label { display:block; margin-bottom:.5rem; }
.fm-brand-logo-field { border:0; padding:0; margin:1.5rem 0; min-width:0; }
.fm-brand-logo-field legend { font-size:1rem; font-weight:700; margin-bottom:.75rem; }
.fm-brand-logo-row { display:flex; align-items:center; gap:1rem; }
.fm-brand-editor .fm-brand-logo-inspector { width:148px; height:132px; flex:none; border:1px solid #aab5c4; border-radius:12px; display:grid; place-items:center; padding:10px; background-color:#eef2f7; background-image:repeating-conic-gradient(#dce3ec 0% 25%,transparent 0% 50%); background-size:16px 16px; color:#26384b; text-align:center; font-size:.85rem; }
.fm-brand-editor .fm-brand-logo-inspector img { width:100%; height:100%; max-height:110px; object-fit:contain; }
.fm-brand-logo-actions { display:flex; flex-direction:column; align-items:stretch; gap:.5rem; }
.fm-brand-editor .fm-brand-file-input { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.fm-brand-editor [hidden] { display:none !important; }
.fm-brand-status { min-height:1.5rem; margin-top:.5rem; font-size:.875rem; }
.fm-brand-status[data-error="true"] { color:#ffb4b4; }
.fm-brand-external summary { cursor:pointer; font-size:.875rem; }
.fm-brand-external label { margin-top:.75rem; }
.fm-brand-colors { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.fm-brand-colors input { height:48px; padding:6px; cursor:pointer; }
.fm-brand-colors small { display:block; margin-top:.4rem; font-family:monospace; color:#bdc7d6; }
.fm-brand-live { position:sticky; top:90px; }
.fm-brand-eyebrow { text-transform:uppercase; letter-spacing:.1em; font-size:.75rem; color:#bdc7d6; font-weight:700; }
.fm-brand-editor .fm-brand-preview { margin:0; border:1px solid #424d5b; border-radius:16px; background:#0c121b; overflow:hidden; }
.fm-brand-preview-header { display:flex; align-items:center; gap:.8rem; padding:1.2rem; border-bottom:2px solid var(--fm-preview-accent); min-height:90px; }
.fm-brand-editor .fm-brand-preview-logo { width:60px; height:60px; object-fit:contain; border-radius:8px; padding:4px; background:#f1f5f9; }
.fm-brand-preview-content { padding:1.4rem 1.2rem 1.8rem; }
.fm-brand-preview-content h3 { font-size:1.2rem; margin-bottom:.8rem; }
.fm-brand-preview-content p { font-size:.9rem; color:#bdc7d6; margin-bottom:1.5rem; }
.fm-brand-editor .fm-brand-preview-action { display:inline-block; border:1px solid var(--fm-preview-accent); border-radius:10px; padding:.7rem 1rem; background:var(--fm-preview-primary); color:var(--fm-preview-foreground); font-weight:700; }
.fm-brand-preview-accent { border-top:1px solid #424d5b; padding:.85rem 1.2rem; font-size:.8rem; color:#bdc7d6; }
.fm-brand-savebar { margin-top:1.5rem; border-top:1px solid #424d5b; padding-top:1rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.fm-brand-savebar small { display:block; color:#bdc7d6; margin-top:.25rem; }
.fm-brand-savebar [data-dirty="true"] { color:#ffe29a; }
.fm-brand-gallery-dialog { width:min(780px,calc(100% - 2rem)); max-height:85vh; padding:1.5rem; margin:auto; background:#151c27; color:#f8fafc; border:1px solid #64748b; border-radius:18px; box-shadow:0 24px 80px #0009; overflow:auto; }
.fm-brand-gallery-dialog::backdrop { background:#000b; }
.fm-brand-gallery-dialog header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.fm-brand-gallery-dialog h2 { font-size:1.4rem; }
.fm-brand-gallery-dialog p { font-size:.875rem; color:#c1c8d3; }
.fm-brand-gallery-search label { display:block; margin-bottom:.4rem; }
.fm-brand-gallery-search>div { display:flex; gap:.5rem; margin-bottom:1rem; }
.fm-brand-gallery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(175px,1fr)); gap:1rem; }
.fm-brand-gallery-card { border:1px solid #485569; border-radius:12px; padding:.65rem; min-width:0; }
.fm-brand-gallery-card[data-selected="true"] { border:2px solid var(--fm-red-2,#83c4ff); }
.fm-brand-gallery-card .fm-brand-gallery-image { display:grid; place-items:center; width:100%; height:130px; margin-bottom:.6rem; background:#edf2f7 repeating-conic-gradient(#dce3ec 0% 25%,transparent 0% 50%) 0/16px 16px; border-radius:8px; color:#26384b; font-size:.85rem; text-align:center; }
.fm-brand-gallery-card img { width:100%; height:100%; max-height:130px; object-fit:contain; }
.fm-brand-gallery-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:.6rem; }
.fm-brand-gallery-card button { width:100%; margin-top:.3rem; }
@media(max-width:900px) { .fm-brand-editor-grid{grid-template-columns:1fr;} .fm-brand-live{position:static;} }
@media(max-width:480px) { .fm-brand-savebar{align-items:stretch;flex-direction:column;} .fm-brand-logo-row{gap:.75rem;} .fm-brand-editor .fm-brand-logo-inspector{width:110px;height:120px;} .fm-brand-gallery-dialog{padding:1rem;} .fm-brand-gallery-grid{grid-template-columns:1fr 1fr;gap:.5rem;} }
/* Public entry: no authenticated dashboard controls or third-party dependencies. */
.fm-reseller-entry { margin:0; min-height:100vh; display:flex; flex-direction:column; font:16px/1.6 system-ui,sans-serif; color:#f8fafc; background:#0b1017; }
.fm-entry-header { border-bottom:3px solid var(--fm-red-2); padding:1.25rem max(1.25rem,calc((100vw - 1080px)/2)); display:flex; align-items:center; gap:1rem; }
.fm-entry-logo { max-width:190px; max-height:68px; object-fit:contain; padding:6px; background:#f1f5f9; border-radius:8px; }
.fm-entry-header strong { font-size:1.25rem; }
.fm-entry-main { width:min(650px,calc(100% - 3rem)); margin:auto; padding:3rem 0; }
.fm-entry-card { padding:clamp(1.5rem,4vw,2.75rem); border:1px solid #384454; border-top:4px solid var(--fm-red-2); border-radius:18px; background:#151c27; }
.fm-entry-card h1 { line-height:1.2; font-size:clamp(1.7rem,4vw,2.3rem); margin:0 0 1rem; }
.fm-entry-card p { color:#c5cfdd; }
.fm-entry-cta { display:block; text-align:center; text-decoration:none; background:var(--fm-red); color:var(--fm-brand-foreground); border:1px solid var(--fm-red-2); padding:.85rem 1rem; margin:1.8rem 0 1rem; border-radius:10px; font-weight:700; }
.fm-entry-cta:hover,.fm-entry-cta:focus-visible { outline:2px solid var(--fm-red-2); outline-offset:3px; }
.fm-entry-card .fm-entry-note { font-size:.85rem; margin-bottom:0; }
.fm-entry-footer { text-align:center; padding:1rem; color:#a8b5c6; font-size:.8rem; }

/* Reseller navigation remains distinguishable from owner tools and customer branding. */
.main-sidebar .nav-sidebar .nav-link.fm-reseller-link {
    background: rgba(150, 110, 230, .13) !important;
    border: 1px solid rgba(185, 151, 255, .25) !important;
    border-left: 3px solid #b997ff !important;
    border-radius: .75rem;
    color: #f1eaff !important;
}
.main-sidebar .nav-sidebar .nav-link.fm-reseller-link:hover,
.main-sidebar .nav-sidebar .nav-link.fm-reseller-link:focus-visible,
.main-sidebar .nav-sidebar .nav-link.fm-reseller-link.active {
    background: #49366d !important;
    border-color: #d2baff !important;
    color: #fff !important;
}
.main-sidebar .nav-sidebar .fm-reseller-heading { color: #d2baff; letter-spacing: .08em; padding-top: 1rem; }
.reseller-dns-table code { white-space: normal; overflow-wrap: anywhere; }
.reseller-dns-table td { vertical-align: middle; }
.reseller-domain-dialog {
    color: #edf2f7; background: #151c26; border: 1px solid #66768b;
    border-radius: 1rem; padding: 1.5rem; width: min(38rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem); overflow: auto;
}
.reseller-domain-dialog::backdrop { background: rgba(0,0,0,.65); }
.reseller-domain-dialog [hidden] { display: none !important; }
.reseller-domain-dialog [data-verify-status] { background: #202c3c; border-radius: .5rem; padding: 1rem; min-height: 5rem; }
.reseller-portal-links .input-group { flex-wrap: nowrap; }
.reseller-portal-links .form-control { min-width: 0; }
