[data-copilotlogin-widget] {
    --copilotlogin-accent: #0f6b78;
    --copilotlogin-accent-strong: #0b4d56;
    --copilotlogin-accent-soft: #ecfeff;
    --copilotlogin-surface: rgba(255, 255, 255, 0.98);
    --copilotlogin-border: rgba(15, 107, 120, 0.16);
    --copilotlogin-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
    --copilotlogin-radius: 22px;
    position: fixed;
    right: clamp(1rem, 2vw, 1.5rem);
    bottom: clamp(1rem, 2vw, 1.5rem);
    z-index: 1085;
    font: inherit;
}

[data-copilotlogin-widget] *,
[data-copilotlogin-widget] *::before,
[data-copilotlogin-widget] *::after {
    box-sizing: border-box;
}

html.copilotlogin-open,
body.copilotlogin-open {
    overflow: hidden;
}

.copilotlogin-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    cursor: pointer;
}

.copilotlogin-launcher:focus {
    outline: none;
}

.copilotlogin-launcher:focus-visible .copilotlogin-launcher-shell {
    box-shadow:
        0 0 0 4px rgba(14, 165, 233, 0.18),
        0 18px 36px rgba(15, 23, 42, 0.24);
}

.copilotlogin-tooltip {
    position: relative;
    display: block;
    max-width: 240px;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff, #effcfd);
    border: 1px solid rgba(148, 220, 228, 0.85);
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    transition:
        opacity 0.24s ease,
        transform 0.24s ease,
        visibility 0.24s ease;
    animation: copilotlogin-tooltip-float 2.8s ease-in-out infinite;
}

.copilotlogin-tooltip::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #f3feff;
    border-right: 1px solid rgba(148, 220, 228, 0.85);
    border-bottom: 1px solid rgba(148, 220, 228, 0.85);
    transform: translateY(-50%) rotate(-45deg);
}

.copilotlogin-widget.is-open .copilotlogin-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    animation: none;
}

.copilotlogin-launcher-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 254, 255, 0.98));
    border: 1px solid rgba(148, 220, 228, 0.9);
    box-shadow:
        0 18px 36px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.copilotlogin-launcher:hover .copilotlogin-launcher-shell {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(34, 161, 176, 0.75);
    box-shadow:
        0 24px 44px rgba(15, 23, 42, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.copilotlogin-launcher-ring {
    position: absolute;
    inset: 8px;
    border-radius: inherit;
    border: 1.5px solid rgba(34, 161, 176, 0.4);
    box-shadow: 0 0 0 0 rgba(34, 161, 176, 0.22);
    animation: copilotlogin-pulse 2.9s ease-out infinite;
}

.copilotlogin-launcher-avatar {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    display: block;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.18));
}

.copilotlogin-backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at bottom right, rgba(15, 107, 120, 0.16), transparent 32%),
        rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.copilotlogin-widget.is-open .copilotlogin-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.copilotlogin-panel {
    position: fixed;
    right: clamp(1rem, 2vw, 1.5rem);
    bottom: calc(clamp(1rem, 2vw, 1.5rem) + 6.5rem);
    width: min(430px, calc(100vw - 2rem));
    height: min(700px, calc(100vh - 7rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--copilotlogin-radius);
    background: var(--copilotlogin-surface);
    border: 1px solid var(--copilotlogin-border);
    box-shadow: var(--copilotlogin-shadow);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px) scale(0.97);
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        visibility 0.28s ease;
}

.copilotlogin-widget.is-open .copilotlogin-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.copilotlogin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.95rem 1.1rem;
    background: linear-gradient(135deg, #0b2447 0%, #0f6b78 58%, #22a1b0 100%);
    color: #ffffff;
}

.copilotlogin-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.copilotlogin-brand__logo {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 10px 18px rgba(2, 6, 23, 0.16));
    flex: 0 0 auto;
}

.copilotlogin-brand__copy {
    min-width: 0;
}

.copilotlogin-brand__eyebrow {
    margin: 0 0 0.18rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.copilotlogin-brand__title {
    margin: 0;
    color: #ffffff;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.2;
}

.copilotlogin-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.copilotlogin-close:hover,
.copilotlogin-close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.copilotlogin-panel__intro {
    padding: 0.95rem 1.1rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(240, 249, 250, 0.92));
}

.copilotlogin-panel__intro p {
    margin: 0.4rem 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
}

.copilotlogin-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    background: var(--copilotlogin-accent-soft);
    color: var(--copilotlogin-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.copilotlogin-status::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0.28rem rgba(16, 185, 129, 0.16);
}

.copilotlogin-frame-shell {
    flex: 1;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 251, 253, 1));
}

.copilotlogin-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

@keyframes copilotlogin-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
        box-shadow: 0 0 0 0 rgba(34, 161, 176, 0.25);
    }
    100% {
        transform: scale(1.25);
        opacity: 0;
        box-shadow: 0 0 0 18px rgba(34, 161, 176, 0);
    }
}

@keyframes copilotlogin-tooltip-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@media (max-width: 767px) {
    [data-copilotlogin-widget] {
        right: 0.85rem;
        bottom: 0.85rem;
    }

    .copilotlogin-launcher-shell {
        width: 88px;
        height: 88px;
    }

    .copilotlogin-launcher-avatar {
        width: 64px;
        height: 64px;
    }

    .copilotlogin-tooltip {
        display: none;
    }

    .copilotlogin-panel {
        right: 0.85rem;
        left: 0.85rem;
        width: auto;
        height: min(34rem, calc(100vh - 7rem));
        bottom: calc(5.7rem + 1rem);
    }
}

@media (max-width: 480px) {
    .copilotlogin-launcher-shell {
        width: 84px;
        height: 84px;
    }

    .copilotlogin-launcher-avatar {
        width: 62px;
        height: 62px;
    }

    .copilotlogin-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: min(82vh, 40rem);
        border-radius: 20px 20px 0 0;
    }

    .copilotlogin-backdrop {
        background: rgba(15, 23, 42, 0.34);
    }
}

@media (prefers-reduced-motion: reduce) {
    .copilotlogin-tooltip,
    .copilotlogin-launcher-shell,
    .copilotlogin-launcher-ring,
    .copilotlogin-backdrop,
    .copilotlogin-panel,
    .copilotlogin-close {
        animation: none;
        transition: none;
    }
}
