:root {
    --bg: #0f172a;
    --surface: #111c33;
    --surface-2: #17233d;
    --border: #26344f;
    --text: #e5eaf3;
    --muted: #93a1b8;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --success: #34d399;
    --danger: #f87171;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at 15% -10%, #1e3a5f 0, var(--bg) 42%);
    color: var(--text);
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

h1,
h2 {
    margin: 0;
}

h1:focus {
    outline: none;
}

.app-layout {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 2rem;
    background: rgba(15, 23, 42, 0.82);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(18px);
}

.brand {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar-tag {
    color: var(--muted);
    font-size: 0.82rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.app-content {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.page-shell {
    display: grid;
    gap: 1.2rem;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.1));
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 0.65rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.hero-subtitle {
    max-width: 650px;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.hero-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.hero-badge span {
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(56, 189, 248, 0.42);
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
}

.migration-form,
.form-section,
.log-section,
.alert {
    background: rgba(17, 28, 51, 0.78);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.migration-form {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
}

.form-section {
    padding: 1rem;
}

.form-section h2 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.field-wide {
    grid-column: 1 / -1;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"] {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text);
    font: inherit;
}

.field input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.checkbox-field {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-weight: 500;
}

.checkbox-field input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 500;
}

.validation-summary {
    color: var(--danger);
}

.actions {
    display: flex;
    gap: 0.8rem;
    padding: 0.2rem;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 0.8rem 1.15rem;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

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

.primary {
    background: var(--accent);
    color: #07111f;
}

.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.link-button {
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    border-radius: 0;
}

.alert {
    padding: 1rem;
}

.alert.error {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(127, 29, 29, 0.28);
}

.alert.success {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(6, 78, 59, 0.28);
}

.alert pre {
    margin: 0.7rem 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #fecaca;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.86rem;
}

.alert code {
    color: #99f6e4;
}

.alert ul {
    margin: 0.7rem 0 0 1.2rem;
    padding: 0;
}

.log-section {
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.log-header h2 {
    font-size: 0.95rem;
}

.log-output {
    max-height: 360px;
    overflow: auto;
    padding: 0.9rem 1rem;
    background: rgba(2, 6, 23, 0.5);
    color: #b6c2d9;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.55;
}

.log-output div {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.9rem;
    background: #b32121;
    color: white;
    z-index: 1000;
}

#blazor-error-ui.dismiss {
    display: none;
}

@media (max-width: 760px) {
    .app-content {
        width: min(100% - 1rem, 1120px);
        padding-top: 1rem;
    }

    .hero {
        flex-direction: column;
        padding: 1.3rem;
    }

    .hero-badge {
        align-items: flex-start;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-wide,
    .checkbox-field {
        grid-column: auto;
    }
}
