/* ─── Global Design Tokens ───────────────────────────────── */
:root {
    --bl-primary: #4338ca;
    --bl-primary-dark: #3730a3;
    --bl-accent: #06b6d4;
    --bl-surface: #ffffff;
    --bl-bg: #f4f5fb;
    --bl-text: #1f2337;
    --bl-muted: #6b7280;
    --bl-border: #e5e7ef;
    --bl-danger: #dc2626;
    --bl-success: #059669;
    --bl-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --bl-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --bl-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.05);
    --bl-radius-md: 12px;
    --bl-radius-lg: 20px;
}

/* ─── Base ───────────────────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--bl-text);
    background-color: var(--bl-bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(67, 56, 202, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 100% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(67, 56, 202, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

/* ─── Landing / hero pages ───────────────────────────────── */
.landing-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 72px);
    padding: 56px 24px 48px;
    animation: blFadeUp .35s ease both;
}

.landing-container .mud-paper {
    border-radius: var(--bl-radius-lg) !important;
    box-shadow: var(--bl-shadow-lg) !important;
    border: 1px solid var(--bl-border);
    margin: 0 auto !important;
}

@keyframes blFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Form page ──────────────────────────────────────────── */
.form-container {
    padding-top: 32px;
    padding-bottom: 64px;
}

.form-container .mud-paper {
    border-radius: var(--bl-radius-md) !important;
    border: 1px solid var(--bl-border);
    transition: box-shadow .2s ease, transform .2s ease;
}

.form-container .mud-paper:hover {
    box-shadow: var(--bl-shadow-md) !important;
}

/* Section title accent */
.form-container .mud-paper .mud-typography-h6 {
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: .01em;
}

.form-container .mud-paper .mud-typography-h6::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--bl-primary), var(--bl-accent));
}

/* Conditional group soft card */
.conditional-group {
    border-radius: var(--bl-radius-md) !important;
    background: linear-gradient(180deg, rgba(67, 56, 202, 0.04), rgba(67, 56, 202, 0.015)) !important;
    border: 1px solid rgba(67, 56, 202, 0.12);
    border-left: 4px solid var(--bl-primary) !important;
}

.conditional-children {
    border-radius: 10px !important;
    background: var(--bl-surface) !important;
    border: 1px solid var(--bl-border);
}

/* ─── Buttons ────────────────────────────────────────────── */
.mud-button-root {
    border-radius: 10px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease !important;
}

.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--bl-primary), var(--bl-primary-dark)) !important;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.28) !important;
}

.mud-button-filled.mud-button-filled-primary:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(67, 56, 202, 0.34) !important;
}

.mud-button-filled.mud-button-filled-error {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
}

/* ─── Inputs ─────────────────────────────────────────────── */
.mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px !important;
}

.mud-input-outlined:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.12);
}

/* ─── Chips ──────────────────────────────────────────────── */
.mud-chip {
    border-radius: 999px !important;
    font-weight: 500 !important;
    letter-spacing: .01em;
}

/* ─── Form-type cards (ChooseFormType) ───────────────────── */
.form-type-card {
    border-radius: var(--bl-radius-md) !important;
    border: 1px solid var(--bl-border);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.form-type-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bl-shadow-lg);
    border-color: transparent;
}

/* ─── App bar gradient ───────────────────────────────────── */
.mud-appbar.mud-appbar-dark {
    background: linear-gradient(110deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: saturate(140%) blur(8px);
}

/* ─── Misc ───────────────────────────────────────────────── */
.mud-toggle-group { width: fit-content; }

/* Yes/No + other toggle groups: give buttons room to breathe */
.mud-toggle-group .mud-toggle-item {
    min-width: 96px;
    padding: 8px 20px !important;
    font-weight: 600;
    letter-spacing: .02em;
}

.mud-toggle-group .mud-toggle-item-selected {
    box-shadow: inset 0 0 0 2px var(--bl-primary);
}

hr, .mud-divider { border-color: var(--bl-border) !important; }

/* Blazor reconnect / error overlay */
#blazor-error-ui {
    background: #fef3c7;
    color: #78350f;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 500;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .landing-container { padding: 24px 16px; }
    .form-container { padding: 16px !important; }
}

