html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: #0f172a;
}

body {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    padding: 2rem 2.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow:
        0 10px 30px -12px rgba(15, 23, 42, 0.18),
        0 4px 10px -4px rgba(15, 23, 42, 0.06);
}

.auth-header {
    margin-bottom: 1.25rem;
}

.auth-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.auth-header p,
.auth-card > p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.auth-card textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.auth-card textarea:focus,
.auth-card input:focus {
    outline: none;
    border-color: #0d6efd;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18);
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.auth-card input:disabled,
.auth-card textarea:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.auth-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 1rem 1rem;
    margin: 1rem 0 0;
    background: #f8fafc;
}

.auth-fieldset legend {
    padding: 0 0.4rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-hint {
    margin: 0.25rem 0 0.75rem;
    color: #64748b;
    font-size: 0.78rem;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .auth-row {
        grid-template-columns: 1fr;
    }
}

.auth-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-field .auth-label {
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.auth-label {
    display: block;
    margin-top: 0.9rem;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #334155;
    letter-spacing: 0.01em;
}

.auth-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.auth-buttons button {
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    border: 1px solid #0d6efd;
    background: #0d6efd;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.auth-buttons button:hover:not(:disabled) {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.auth-buttons button:active:not(:disabled) {
    transform: translateY(1px);
}

.auth-btn-secondary {
    background: #ffffff !important;
    color: #0d6efd !important;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: #eff6ff !important;
}

.auth-card button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-error {
    padding: 0.6rem 0.85rem;
    margin-top: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.85rem;
}

.chat-outer {
    max-width: 596px;
    height: 800px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    font-family: system-ui, sans-serif;
}

/*
 * The widget defaults to `position: fixed` (so it floats bottom-right of
 * the viewport when embedded in a real product). For the BlazorChat mock
 * host we want it inline inside `.chat-outer`, filling the 800px box so
 * the internal scroll container drives overflow. Override the public CSS
 * variables (documented on PipChatWidget host: --pip-widget-position,
 * --pip-widget-width, --pip-widget-height) instead of fighting `:host`
 * styles from outside.
 */
.chat-outer > ui-pip-chat-widget {
    flex: 1;
    min-height: 0;
    --pip-widget-position: relative;
    --pip-widget-width: 100%;
    --pip-widget-height: 100%;
    --pip-widget-offset-bottom: 0;
    --pip-widget-offset-right: 0;
}
