:root {
    --primary: #0C5DF4;
    --primary-light: #eff6ff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --success: #22c55e;
    --warning: #f97316;
    --error: #ef4444;
    --transition: 0.15s;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}
.header-text h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.header-text .tagline {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
}
header nav {
    display: flex;
    gap: 20px;
    align-items: center;
}
header a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}
header a:hover { color: white; }
.header-contact {
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}
.header-contact:hover {
    background: rgba(255,255,255,0.15);
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.6);
    padding: 24px 20px;
    margin-top: auto;
    font-size: 0.85rem;
}
.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}
.footer-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    opacity: 0.8;
}
.footer-links {
    display: flex;
    gap: 20px;
}
.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-links a:hover { color: white; }
.footer-note {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
}
@media (max-width: 600px) {
    .footer-inner { flex-direction: column; text-align: center; }
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin: 24px 0;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    width: 100%;
}
.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
}
.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-weight: 600;
    font-size: 0.75rem;
}
.progress-step.active .step-number {
    background: var(--primary);
    color: white;
}
.progress-step.active { color: var(--text-dark); font-weight: 500; }
.progress-step.completed .step-number {
    background: var(--primary);
    color: white;
}
.progress-step.completed { color: var(--text-muted); cursor: pointer; }
.progress-step.completed:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
.progress-step.clickable { cursor: pointer; }
.progress-step.clickable:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Form Card */
.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 32px;
    width: 100%;
}
@media (min-width: 769px) {
    .form-card {
        min-height: 550px;
    }
}
.step-content { display: none; }
.step-content.active { display: block; }
.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}
.step-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Process Selection */
.process-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.process-option {
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.process-option:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}
.process-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.process-option h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.process-option p {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.process-fees {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.process-leadtime {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.process-leadtime .leadtime-loading {
    color: #94a3b8;
    font-style: italic;
}
.process-leadtime .leadtime-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.process-leadtime .same-day {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
}
.process-leadtime .standard-time {
    color: var(--text-muted);
}

/* File Upload */
.file-upload {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-light);
}
.file-upload:hover, .file-upload.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload.hidden {
    display: none;
}
.file-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.file-upload p { color: var(--text-muted); }
.file-upload .types { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* Analysis Results */
.analysis-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    overflow: hidden;
}
.analysis-layout {
    display: flex;
    flex-direction: column;
}
.analysis-preview {
    background: var(--bg-dark);
    min-height: 320px;
    position: relative;
    overflow: hidden;
    cursor: grab;
}
.analysis-preview:active { cursor: grabbing; }
.analysis-preview .svg-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center by default before JS runs */
    transform-origin: center center;
    transition: none;
}
.analysis-preview svg {
    display: block;
}
.analysis-preview svg path,
.analysis-preview svg line,
.analysis-preview svg circle,
.analysis-preview svg polyline,
.analysis-preview svg polygon,
.analysis-preview svg rect:not([stroke-dasharray]),
.analysis-preview svg ellipse {
    stroke: #60a5fa !important;
    fill: none !important;
    stroke-width: 2.5px;
    vector-effect: non-scaling-stroke;
}
/* Dimension labels */
.dimension-label {
    position: absolute;
    background: rgba(96, 165, 250, 0.9);
    color: var(--text-dark);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}
.dimension-label.width {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.dimension-label.height {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}
/* Zoom controls */
.preview-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.preview-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.preview-controls button:hover { background: rgba(255,255,255,0.25); }
.preview-controls button:active { background: rgba(255,255,255,0.35); }
.zoom-level {
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    padding: 0 8px;
    display: flex;
    align-items: center;
}
.analysis-info {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
}
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.analysis-header h4 { font-size: 0.9rem; color: var(--text-dark); margin: 0; }
.analysis-header .file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.analysis-header .remove { color: var(--error); cursor: pointer; font-size: 0.85rem; }
.analysis-header .remove:hover { text-decoration: underline; }
.analysis-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.stat-item { text-align: center; }
.stat-value { font-size: 1.1rem; font-weight: 600; color: var(--text-dark); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 600px) {
    .analysis-preview { min-height: 200px; }
    .analysis-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Quick Quote Section */
.quick-quotes {
    margin-top: 24px;
}
.quick-quotes h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}
.quick-quote-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.quick-quote-card {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    background: white;
}
.quick-quote-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 93, 244, 0.1);
}
.quick-quote-card .material { font-weight: 600; font-size: 0.9rem; }
.quick-quote-card .thickness { font-size: 0.8rem; color: var(--text-muted); }
.quick-quote-card .price {
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.quick-quote-card .price-note { font-size: 0.7rem; color: var(--text-light); }

/* Material Selection - Category Groups */
.material-categories { margin-top: 16px; }
.material-category {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-light);
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.1s;
}
.category-header:hover { background: #f1f5f9; }
.category-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.category-header .count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}
.category-header .chevron {
    color: var(--text-light);
    transition: transform 0.2s;
}
.category-header.collapsed .chevron { transform: rotate(-90deg); }
.category-items { display: block; }
.category-items.collapsed { display: none; }

/* Material Selection - Compact Table Style */
.materials-table {
    width: 100%;
    border-collapse: collapse;
}
.materials-table th {
    text-align: left;
    padding: 10px 16px;
    background: white;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}
.materials-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.materials-table tr {
    cursor: pointer;
    transition: background 0.1s;
}
.materials-table tbody tr:last-child td { border-bottom: none; }
.materials-table tr:hover { background: var(--bg-light); }
.materials-table tr.selected {
    background: var(--primary-light);
}
.materials-table .mat-name { font-weight: 500; }
.materials-table .mat-thicknesses { color: var(--text-muted); font-size: 0.8rem; }
.materials-table .mat-price {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.materials-table .mat-price small {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Quantity Selection */
.quantity-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    margin-top: 16px;
}
.quantity-input-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.big-quantity-input {
    width: 100%;
    padding: 32px;
    border: 2px solid var(--border);
    border-radius: 16px;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    transition: all var(--transition);
}
.big-quantity-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(12, 93, 244, 0.1);
}
.big-quantity-input::placeholder {
    color: #cbd5e1;
}
.quantity-price-display {
    margin-top: 16px;
    text-align: center;
}
.quantity-price-display .total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}
.quantity-price-display .per-unit {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.volume-pricing {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
}
.volume-pricing h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.volume-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.1s;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}
.volume-tier:last-child { border-bottom: none; }
.volume-tier:hover { background: #f1f5f9; }
.volume-tier .qty {
    font-weight: 600;
    color: var(--text-dark);
}
.volume-tier .price-info {
    text-align: right;
}
.volume-tier .price {
    font-weight: 600;
    color: var(--text-dark);
}
.volume-tier .savings {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}
@media (max-width: 768px) {
    .quantity-layout {
        grid-template-columns: 1fr;
    }
    .big-quantity-input {
        font-size: 2rem;
        padding: 24px;
    }
}

/* Lead Time Selection */
.leadtime-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.leadtime-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
    background: white;
}
.leadtime-option:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}
.leadtime-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.leadtime-option.rush {
    border-color: #f59e0b;
}
.leadtime-option.rush.selected {
    border-color: #f59e0b;
    background: #fffbeb;
}
.leadtime-option .left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.leadtime-option .icon {
    font-size: 1.5rem;
}
.leadtime-option .dates .label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}
.leadtime-option .dates .range {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.leadtime-option .right {
    text-align: right;
}
.leadtime-option .price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}
.leadtime-option .modifier {
    font-size: 0.8rem;
    margin-top: 2px;
}
.leadtime-option .modifier.rush {
    color: #f59e0b;
}
.leadtime-option .modifier.discount {
    color: var(--success);
}
.leadtime-option.recommended {
    position: relative;
}
.leadtime-option.recommended::after {
    content: 'Recommended';
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Add-ons */
.addons-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}
.addon-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition);
}
.addon-card.selected {
    border-color: var(--primary);
}
.addon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    background: white;
}
.addon-header:hover {
    background: var(--bg-light);
}
.addon-header .left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.addon-header .icon {
    font-size: 1.5rem;
}
.addon-header .info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}
.addon-header .info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}
.addon-header .right {
    text-align: right;
}
.addon-header .starting-at {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.addon-header .price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}
.addon-header .checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    transition: all var(--transition);
}
.addon-card.selected .addon-header .checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.addon-options {
    display: none;
    padding: 16px 20px;
    background: var(--bg-light);
    border-top: 1px solid #e2e8f0;
}
.addon-card.selected .addon-options {
    display: block;
}
.addon-options h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all var(--transition);
}
.color-option:hover {
    border-color: var(--primary);
}
.color-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}
.color-option .name {
    font-size: 0.85rem;
    font-weight: 500;
}
.color-option .price {
    font-size: 0.8rem;
    color: var(--primary);
    margin-left: auto;
}
.color-option.sold-out, .option-item.sold-out {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border);
    background: var(--bg-light);
}
.color-option.sold-out:hover, .option-item.sold-out:hover {
    border-color: var(--border);
}
.stock-status {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    margin-left: auto;
}
.addon-buffer-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 16px;
}
.option-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all var(--transition);
}
.option-item:hover {
    border-color: var(--primary);
}
.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.option-item .name {
    font-weight: 500;
}
.option-item .price {
    font-weight: 600;
    color: var(--primary);
}
.no-addons {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Material Selection Layout - two columns on desktop */
.material-selection-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 769px) {
    .material-selection-layout {
        grid-template-columns: 1fr 320px;
    }
}
.material-selection-main {
    min-width: 0;
}

/* Material Sidebar - contains preview and info */
.material-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 3D Preview Panel for Filament Selection */
.material-preview-panel {
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
}
.material-preview-panel canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.material-preview-panel.hidden {
    display: none;
}

/* Material Info Panel - Sidebar */
.material-info-panel {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 20px;
}
.material-info-panel.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    color: var(--text-muted);
}
.material-info-panel.empty .icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}
.material-info-panel h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.material-info-panel .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}
.material-props-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.material-prop {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.material-prop .label {
    font-size: 0.65rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.material-prop .value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dark);
}
.material-prop .value.high { color: var(--success); }
.material-prop .value.medium { color: #f59e0b; }
.material-prop .value.low { color: var(--error); }
.common-uses {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.common-uses strong { color: var(--text-dark); }

/* Filament Grid */
.filaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.filament-option {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.filament-option:hover { border-color: var(--primary); }
.filament-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.filament-option strong { display: block; font-size: 0.95rem; }
.filament-option .price {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Filament Color Selection */
.filament-color-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.filament-color-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.filament-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filament-color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    background: white;
    min-width: 70px;
}
.filament-color-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.filament-color-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(12, 93, 244, 0.2);
}
.filament-color-option .color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.filament-color-option .color-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}
.filament-color-option.selected .color-name {
    color: var(--text-dark);
}

/* Selected Material Summary (on thickness page) */
.selected-material-summary {
    background: linear-gradient(135deg, var(--bg-light) 0%, white 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.selected-material-summary .material-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.selected-material-summary .material-details {
    flex: 1;
}
.selected-material-summary .material-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}
.selected-material-summary .material-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}
.selected-material-summary .change-link {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}
.selected-material-summary .change-link:hover {
    text-decoration: underline;
}

/* Thickness Selection */
.thickness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.thickness-option {
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.thickness-option:hover { border-color: var(--primary); }
.thickness-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.thickness-option .label {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
}
.thickness-option .price {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 4px;
}
.thickness-option .details {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Quality Selection */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.quality-option {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.quality-option:hover { border-color: var(--primary); }
.quality-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.quality-option .name { font-weight: 600; font-size: 1rem; }
.quality-option .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 8px;
}
.quality-option .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Contact Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 93, 244, 0.1);
}

/* ITAR Checkbox */
.itar-checkbox {
    margin: 20px 0;
    padding: 16px;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}
.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.checkbox-text strong {
    color: #854d0e;
    font-size: 0.9rem;
}
.checkbox-hint {
    color: #a16207;
    font-size: 0.8rem;
}

/* Final Quote Layout */
.final-quote-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (min-width: 769px) {
    .final-quote-layout {
        grid-template-columns: 200px 1fr;
        gap: 32px;
    }
}
.final-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.final-preview-container {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.final-preview-container canvas {
    width: 100% !important;
    height: 100% !important;
}
.final-preview-container svg {
    max-width: 90%;
    max-height: 90%;
}
.final-preview-filename {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    word-break: break-all;
    max-width: 200px;
}
.final-form-section {
    flex: 1;
}

/* Price Summary */
.price-summary {
    background: var(--bg-dark);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}
.price-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.price-summary-row.total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 1rem;
}
.price-summary-row.total .value {
    font-size: 1.8rem;
    font-weight: 700;
}
.price-summary-row .label { color: rgba(255,255,255,0.7); }
.price-summary-row .value { font-weight: 500; }
.price-summary-row.discount .value { color: #4ade80; }

/* Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}
.btn {
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}
.btn-back {
    background: white;
    color: var(--text-dark);
    border-color: var(--border);
}
.btn-back:hover {
    border-color: var(--text-dark);
}
.btn-next, .btn-submit {
    background: var(--bg-dark);
    color: white;
}
.btn-next:hover, .btn-submit:hover {
    background: #1e293b;
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .process-grid, .quick-quote-grid, .quality-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .analysis-stats { grid-template-columns: repeat(2, 1fr); }
    .progress-bar { flex-wrap: wrap; gap: 8px; }
}

.hidden { display: none !important; }

/* 3D Preview */
#stl-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
