﻿.auth-input .mud-input-label {
    color: white !important;
}

/* Chrome autofill fix on dark */
input.mud-input-slot:-webkit-autofill {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0 1000px #1F2937 inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

    input.mud-input-slot:-webkit-autofill:hover,
    input.mud-input-slot:-webkit-autofill:focus {
        -webkit-box-shadow: 0 0 0 1000px #1F2937 inset !important;
    }

.luna-pane {
    width: 100%;
    background: none;
}

/* Luna avatar crossfade */
.luna-stage {
    position: relative;
    height: 220px;
    width: clamp(160px, 34vmin, 320px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Background image */
.luna-bg {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 0;
}

/* Avatar image sits on top */
.luna-frame {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    transform: translateY(-20px);
}

.luna-visible {
    opacity: 1;
}

.luna-hidden {
    opacity: 0;
}

/* Popover panel itself */
.luna-popover .mud-popover {
    filter: drop-shadow(0 10px 24px rgba(0,0,0,.24));
    border-radius: 18px;
}

/* Chat container “card” */
.luna-chat {
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, transparent);
    backdrop-filter: saturate(140%) blur(6px);
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-secondary) 14%, transparent);
}

/* Header bar */
.luna-chat__header {
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, transparent);
}

/* Input bar */
.luna-chat__inputbar {
    background: color-mix(in srgb, var(--mud-palette-surface) 98%, transparent);
}

/* Text field lift */
.luna-chat__textfield .mud-input-root {
    border-radius: 12px;
}

    .luna-chat__textfield .mud-input-root:hover {
        box-shadow: 0 1px 4px rgba(0,0,0,.12);
    }

    .luna-chat__textfield .mud-input-root.mud-input-root-filled.mud-input-root-focused,
    .luna-chat__textfield .mud-input-root.mud-input-root-outlined.mud-input-root-focused {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
    }

/* Bubbles */
.luna-msg {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.luna-msg--assistant {
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-secondary) 10%, transparent);
}

.luna-msg--user {
    background: var(--mud-palette-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

    /* Optional: tweak inner MudText spacing */
    .luna-msg--user .mud-typography {
        margin: 0;
    }

/* Force dark styling for the chat subtree only */
.luna-theme-dark {
    color-scheme: dark;
    --mud-palette-background: #0f1115;
    --mud-palette-surface: #161a22;
    --mud-palette-text-primary: rgba(255,255,255,.87);
    --mud-palette-text-secondary: rgba(255,255,255,.60);
    --mud-palette-lines-default: rgba(255,255,255,.12);
    --mud-palette-divider: rgba(255,255,255,.12);
    --mud-palette-primary: #ff7a1a;
    --mud-elevation-8: 0 10px 24px rgba(0,0,0,.45);
}

    .luna-theme-dark .luna-chat {
        border: 1px solid var(--mud-palette-lines-default);
    }

    .luna-theme-dark .luna-chat__header,
    .luna-theme-dark .luna-chat__inputbar {
        background: #1a1f29;
    }

    .luna-theme-dark .mud-input-root,
    .luna-theme-dark .mud-typography,
    .luna-theme-dark .mud-chip,
    .luna-theme-dark .mud-button,
    .luna-theme-dark .mud-paper,
    .luna-theme-dark .mud-text {
        color: var(--mud-palette-text-primary);
    }

    .luna-theme-dark .mud-input-root-outlined {
        background: #0f1115;
        border-color: var(--mud-palette-lines-default);
    }

    .luna-theme-dark .mud-input-root.mud-input-root-focused {
        box-shadow: 0 0 0 3px rgba(255,122,26,.22);
    }

    .luna-theme-dark .luna-msg--assistant {
        background: #1b2230;
        border: 1px solid var(--mud-palette-lines-default);
    }

    .luna-theme-dark .luna-msg--user {
        box-shadow: 0 2px 8px rgba(0,0,0,.35);
    }
