:root {
    --app-bg: #eef3fb;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #d7e2f2;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eaf2ff;
    --accent: #f59e0b;
}

body {
    background:
        radial-gradient(circle at 20% 10%, #f8fbff 0%, transparent 45%),
        radial-gradient(circle at 80% 0%, #f2f7ff 0%, transparent 42%),
        var(--app-bg);
    color: var(--text-main);
}

main { min-height: calc(100vh - 72px); }

.navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.navbar .navbar-brand {
    color: var(--brand) !important;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand-badge {
    font-size: 12px;
    color: #1e3a8a;
    background: var(--brand-soft);
    border: 1px solid #bfd3ff;
    border-radius: 999px;
    padding: 2px 10px;
}

.page-hero {
    background: linear-gradient(120deg, #fafdff 0%, #ecf3ff 100%);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.5rem;
}

.card {
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
}

.section-title { font-weight: 700; color: #0f172a; }

.form-control, .form-select {
    background: #fff;
    color: var(--text-main);
    border-color: #c9d5e6;
    border-radius: 12px;
}

.form-control:focus, .form-select:focus {
    border-color: #8bb0ff;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}

.soft-panel {
    background: #f8fbff;
    border: 1px solid #d8e5ff;
    border-radius: 12px;
}

.stl-preview-wrap {
    min-height: 260px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7faff 0%, #edf3ff 100%);
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.estimator-layout { align-items: stretch; }

@media (min-width: 992px) {
    .preview-card { position: sticky; top: 5.5rem; height: calc(100vh - 7rem); }
    .preview-card .card-body { display: flex; flex-direction: column; }
    .preview-card .stl-preview-wrap { flex: 1 1 auto; min-height: clamp(420px, 72vh, 900px); }
    .settings-card { height: auto; overflow: visible; }
}

.stl-canvas { position: absolute; inset: 0; z-index: 1; }
.stl-canvas canvas { width: 100%; height: 100%; display: block; }

.stl-viewer-label {
    position: absolute; top: 10px; left: 12px; font-size: 12px;
    color: #2f4f93; border: 1px solid #b5c9f3; border-radius: 999px;
    padding: 3px 10px; background: rgba(255, 255, 255, 0.95);
}

.stl-preview-meta {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
    display: flex; justify-content: space-between; gap: 12px;
    background: #ffffff; border: 1px solid #c9d8f0; border-radius: 10px;
    padding: 10px 12px; color: #1f2937;
}

.stl-preview-empty { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; text-align: center; font-size: 14px; color: var(--text-muted); }

.btn-primary { background-color: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background-color: var(--brand-dark); border-color: var(--brand-dark); }

.btn-outline-primary { border-color: var(--brand); color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); color: #fff; }

.btn-accent { background: var(--accent); color: #1f2937; border: 1px solid #d38900; font-weight: 700; border-radius: 12px; }
.btn-accent:hover { background: #e08b00; color: #111827; }

.auth-card { max-width: 520px; margin-inline: auto; }
.page-shell { padding-top: .5rem; }
.summary-total { color: #dc6b00; }
.link-muted { color: #4364a8; text-decoration: none; }
.link-muted:hover { text-decoration: underline; }
