:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #333;
}

.sensor-configurator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: var(--text-color);
}

.configurator-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: bold;
}

.main-code-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.code-segment {
    min-width: 40px;
    width: auto;
    padding: 0 10px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border-bottom: 3px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--secondary-color);
}

.code-segment.static {
    cursor: default;
    border-bottom: none;
    color: #000;
}

.code-segment.active {
    color: var(--primary-color);
    background: rgba(0, 86, 179, 0.05);
}

.code-segment.filled {
    color: #000;
    border-bottom-color: #28a745;
}

.options-container {
    min-height: 100px;
    padding: 15px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
}

.options-group {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
}

.options-group.active {
    display: flex;
}

.option-button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #fff !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color)
}

.option-button:hover {
    background: var(--bg-color) !important;
    border-color: var(--primary-color) !important;
}

.option-button.selected {
    background: var(--primary-color) !important;
    color: #fff;
    border-color: var(--primary-color) !important;
}

.result-panel {
    margin-top: 30px;
    padding: 20px;
    background: #e9ecef;
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.result-panel.visible {
    display: flex;
}

.final-article {
    font-size: 20px;
    font-weight: bold;
}

.price-display {
    font-size: 22px;
    color: #d9534f;
    font-weight: bold;
}

.order-button {
    display: inline-block;
    padding: 10px 25px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}

.order-button:hover {
    background: #218838;
}

.loading-text {
    font-style: italic;
    color: var(--secondary-color);
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
    line-height: 1;
}

.modal-header {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-right: 20px;
}

.modal-form-group {
    margin-bottom: 15px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-input.invalid {
    border-color: #d9534f;
}

.error-message {
    color: #d9534f;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.modal-submit {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.modal-submit:hover {
    background: #218838;
}

.modal-submit:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
    text-align: center;
    font-weight: 500;
}

.status-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#orderBtn{
    display: none;
}

#resultPanel div div{
    line-height: normal !important;
    margin-bottom: 10px;
}