/* Brand Hub login — circular logo, black stage matching logo canvas */

body:has(.bh-login) {
    background: #050505 !important;
}

body:has(.bh-login) > #app > nav.navbar,
body:has(.bh-login) > .overlay {
    display: none !important;
}

body:has(.bh-login) > #app > main.py-4 {
    padding: 0 !important;
    margin: 0 !important;
}

.bh-login {
    --bh-ink: #050505;
    --bh-panel: rgba(18, 18, 18, 0.72);
    --bh-line: rgba(255, 255, 255, 0.1);
    --bh-muted: rgba(255, 255, 255, 0.58);
    --bh-text: #f4f4f4;
    --bh-accent: #e11d2e;
    --bh-accent-soft: rgba(225, 29, 46, 0.18);
    --bh-green: #7ecf2a;
    --bh-yellow: #f0c419;
    --bh-font: 'Outfit', system-ui, sans-serif;

    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.15rem 2.5rem;
    position: relative;
    overflow: hidden;
    font-family: var(--bh-font);
    color: var(--bh-text);
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(225, 29, 46, 0.22), transparent 55%),
        radial-gradient(ellipse 45% 40% at 85% 85%, rgba(126, 207, 42, 0.1), transparent 50%),
        radial-gradient(ellipse 40% 35% at 10% 80%, rgba(240, 196, 25, 0.08), transparent 50%),
        var(--bh-ink);
}

.bh-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
    animation: bh-grid-drift 28s linear infinite;
}

@keyframes bh-grid-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, 48px, 0); }
}

.bh-login__stage {
    width: min(100%, 420px);
    position: relative;
    z-index: 1;
    animation: bh-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bh-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bh-login__brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.bh-login__logo-wrap {
    width: 132px;
    height: 132px;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 0 6px rgba(255, 255, 255, 0.04),
        0 18px 50px rgba(0, 0, 0, 0.55);
    animation: bh-logo-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

@keyframes bh-logo-in {
    from {
        opacity: 0;
        transform: scale(0.86);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bh-login__logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.bh-login__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bh-muted);
    margin: 0 0 0.55rem;
    animation: bh-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.bh-login__eyebrow::before {
    content: '';
    width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--bh-accent), var(--bh-yellow), var(--bh-green));
    border-radius: 1px;
}

.bh-login__title {
    margin: 0;
    font-size: clamp(1.35rem, 3.5vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

.bh-login__sub {
    margin: 0.45rem 0 0;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--bh-muted);
    line-height: 1.45;
}

.bh-login__panel {
    background: var(--bh-panel);
    border: 1px solid var(--bh-line);
    border-radius: 18px;
    padding: 1.35rem 1.35rem 1.15rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: bh-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.bh-login__panel .form-group {
    margin-bottom: 0.9rem;
}

.bh-login__panel .form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 10px;
    padding: 0.78rem 0.95rem;
    font-size: 0.98rem;
    font-family: var(--bh-font);
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.bh-login__panel .form-control::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.bh-login__panel .form-control:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(225, 29, 46, 0.65);
    box-shadow: 0 0 0 3px var(--bh-accent-soft);
    color: #fff;
    outline: none;
}

.bh-login__panel .form-control:-webkit-autofill,
.bh-login__panel .form-control:-webkit-autofill:hover,
.bh-login__panel .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px #1a1a1a inset;
}

.bh-login__panel .form-control.is-invalid {
    border-color: #ff6b6b;
}

.bh-login__panel .invalid-feedback {
    color: #ff8f8f;
}

.bh-login__remember {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: var(--bh-muted);
    font-size: 0.9rem;
    line-height: 1.2;
    min-height: 1.25rem;
}

.bh-login__remember .form-check-input {
    float: none;
    position: static;
    flex: 0 0 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.25rem;
    background-position: center;
    background-size: 0.65rem;
}

.bh-login__remember .form-check-input:checked {
    background-color: var(--bh-accent);
    border-color: var(--bh-accent);
}

.bh-login__remember .form-check-label {
    color: var(--bh-muted);
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

.bh-login__submit {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-family: var(--bh-font);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #e11d2e 0%, #c41222 100%);
    box-shadow: 0 10px 28px rgba(225, 29, 46, 0.28);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.bh-login__submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 12px 32px rgba(225, 29, 46, 0.38);
    transform: translateY(-1px);
    color: #fff;
}

.bh-login__submit:active {
    transform: translateY(0);
}

.bh-login__links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.95rem;
    flex-wrap: wrap;
}

.bh-login__links a {
    color: var(--bh-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0;
    border: 0;
    background: none;
    transition: color 0.15s;
}

.bh-login__links a:hover {
    color: #fff;
}

.bh-login__alert {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0.7rem 0.85rem;
    font-size: 0.88rem;
    margin-bottom: 0.95rem;
}

.bh-login__alert--error {
    background: rgba(225, 29, 46, 0.12);
    border-color: rgba(225, 29, 46, 0.35);
    color: #ffb4b8;
}

.bh-login__alert--success {
    background: rgba(126, 207, 42, 0.12);
    border-color: rgba(126, 207, 42, 0.35);
    color: #c8f08a;
}

.bh-login__alert .close {
    float: right;
    background: none;
    border: 0;
    color: inherit;
    opacity: 0.7;
    font-size: 1.2rem;
    line-height: 1;
}

/* Device registration CTA on dark login */
.bh-login .bh-device-req-btn {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    color: var(--bh-muted);
    border-radius: 10px;
    margin-top: 1rem;
}

.bh-login .bh-device-req-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.38);
    color: #fff;
}

.bh-login #bh-device-request-msg.text-success {
    color: #c8f08a !important;
}

.bh-login #bh-device-request-msg.text-danger {
    color: #ffb4b8 !important;
}

@media (max-width: 480px) {
    .bh-login {
        padding: 1.5rem 1rem 2rem;
        align-items: flex-start;
        padding-top: 2.5rem;
    }

    .bh-login__logo-wrap {
        width: 108px;
        height: 108px;
    }

    .bh-login__panel {
        padding: 1.15rem 1.05rem 1rem;
    }
}
