:root {
    --primary-color: #0056b3;
    --background-color: #f4f7f9;
    --card-background: #ffffff;
    --text-color: #333;
    --border-color: #dde4e9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 25px 30px;
}

header h1 {
    font-size: 1.8em;
    color: var(--primary-color);
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
}

header p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group, .fieldset {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

legend {
    font-weight: 600;
    padding: 0 10px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
}

button {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background-color: #004494;
}

button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#result-container {
    margin-top: 25px;
    text-align: center;
}

#product-info {
    background-color: #eef5ff;
    border: 1px solid #cce0ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #333;
}

#product-info span {
    display: block;
    font-weight: bold;
    font-size: 1.1em;
}

#product-info small {
    font-size: 0.9em;
}

#qr-canvas {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px auto;
}

.hidden {
    display: none;
}

/* Loader animation */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}