:root {
    --primary: #000;
    --primary-light: #333;
    --accent: #d91a2d;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --border: #ddd;
    --text: #222;
    --text-muted: #777;
    --glass-fill: #e8eaed;
    --glass-stroke: #666;
    --dim-line: #333;
    --cutout-fill: #fff;
    --cutout-stroke: #000;
    --selected: #d91a2d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo {
    height: 32px;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-left: 2px solid var(--border);
    padding-left: 0.75rem;
}

.lang-selector {
    position: static;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.75rem 1rem;
    gap: 0;
}

.step-item {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 2px;
}

.step-item.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.step-item.completed {
    background: #f2f2f2;
    color: var(--primary);
    border-color: #999;
}

.step-item:hover:not(.active) {
    border-color: var(--primary-light);
}

/* Language selector (positioned in header) */

.lang-selector select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    background: #fff;
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
}

.card-body {
    padding: 1rem;
}

.info-box {
    background: #f2f2f2;
    border: 1px solid #c5cae9;
    border-radius: 4px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Model selection */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.model-option {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.model-option:hover {
    border-color: var(--primary-light);
}

.model-option.selected {
    border-color: var(--accent);
    background: #fde8ea;
}

.model-option svg {
    width: 100%;
    height: 80px;
    margin-bottom: 0.5rem;
}

.model-option .label {
    font-size: 0.8rem;
    color: var(--text);
}

/* Side selection */
.side-grid {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.side-option {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.side-option:hover {
    border-color: var(--primary-light);
}

.side-option.selected {
    border-color: var(--accent);
    background: #fde8ea;
}

.side-option svg {
    width: 100%;
    height: 60px;
    margin-bottom: 0.5rem;
}

.side-option .label {
    font-size: 0.85rem;
    color: var(--text);
}

/* Dimensions step */
.dim-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

.dim-inputs .form-group {
    margin-bottom: 0.75rem;
}

.dim-inputs label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.dim-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
}

.dim-inputs input:focus {
    outline: none;
    border-color: var(--primary);
}

/* SVG preview */
.preview-container {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.preview-container svg {
    max-width: 100%;
    max-height: 500px;
}

/* Cutouts step */
.cutouts-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

.cutout-catalog {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.cutout-option {
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
}

.cutout-option:hover {
    border-color: var(--primary-light);
    background: #f2f2f2;
}

.cutout-option {
    position: relative;
}

.cutout-add-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.cutout-option:hover .cutout-add-badge {
    opacity: 1;
}

.cutout-option svg {
    width: 100%;
    height: 50px;
    margin-bottom: 0.3rem;
}

/* Cutout properties panel */
.cutout-props {
    margin-top: 1rem;
}

.cutout-props .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cutout-props .prop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.cutout-props label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.cutout-props input, .cutout-props select {
    width: 100%;
    padding: 0.4rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.cutout-props input:focus, .cutout-props select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-remove {
    background: #e53935;
    color: #fff;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-remove:hover { background: #c62828; }

.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Summary step */
.summary-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.summary-table td:first-child {
    font-weight: 600;
    width: 40%;
}

/* Navigation */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-light); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover { background: #f2f2f2; }

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover { background: #e65100; }

.btn-restart {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-restart:hover { text-decoration: underline; }

/* Active cutout list */
.active-cutouts {
    margin-top: 0.75rem;
}

.active-cutout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: #f2f2f2;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.active-cutout-item.selected {
    background: #fde8ea;
    border: 1px solid var(--accent);
}

/* Panel tabs for U-shape cutouts */
.btn-panel-tab {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.btn-panel-tab:hover {
    border-color: var(--primary-light);
}

.btn-panel-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .dim-layout, .cutouts-layout, .summary-layout {
        grid-template-columns: 1fr;
    }
    .cutout-catalog {
        grid-template-columns: repeat(2, 1fr);
    }
    .side-grid {
        flex-direction: column;
    }
}
