* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 15px 15px 0 0;
}

.header-content {
    margin-bottom: 15px;
}

.language-switcher {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: white;
    color: #667eea;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 600;
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

.intro-section {
    background: white;
    padding: 20px 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.intro-box {
    margin-bottom: 12px;
}

.intro-box:last-child {
    margin-bottom: 0;
}

.info-section {
    background: white;
    padding: 18px 22px;
    margin-top: -10px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.info-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.info-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.country-select-wrapper {
    position: relative;
}

.country-select-wrapper input {
    width: 100%;
    box-sizing: border-box;
}

#country-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    background: white;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

#country-select.placeholder {
    color: #aaa;
}

#country-select option:first-child {
    color: #aaa;
}

.info-group label {
    font-weight: 500;
    color: #444;
    font-size: 0.9em;
}

.info-group input {
    padding: 10px 12px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.info-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.info-group input::placeholder {
    color: #aaa;
    font-size: 0.85em;
}

.intro-box p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
}

form {
    background: white;
    padding: 35px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.info-section {
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 25px;
}

.form-group {
    flex: 1;
}

#rating-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.rating-row:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.rating-row .product-label {
    flex: 0 0 80px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
    text-align: left;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.rating-row .product-label:empty,
.rating-row .product-label:only-child {
    background: #f0f0f0;
    color: #999;
    font-style: italic;
}

.rating-row .score-input {
    flex: 1;
    margin-left: auto;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    min-width: 200px;
}

.rating-row .score-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: white;
}

.rating-row .score-input::placeholder {
    color: #bbb;
    font-weight: 400;
}

.score-guide {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    font-size: 0.85em;
    color: #92400e;
    text-align: center;
}

.rating-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: #f9f9f9;
    text-align: center;
}

.rating-group-wide {
    flex: 2;
}

.score-description {
    margin-top: 12px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85em;
    color: #666;
    border-left: 3px solid #667eea;
}

.selected-product {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 0.95em;
    background: #f0f4ff;
    color: #667eea;
    font-weight: 600;
    text-align: center;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
    background: #f9f9f9;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.question {
    margin-bottom: 30px;
}

.question h2 {
    font-size: 1.15em;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.question h2::before {
    content: '';
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.question-text {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
    font-size: 0.95em;
}

.ranking-hint {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 15px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.two-column-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.other-input-container {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.other-input-wrapper {
    position: relative;
    flex: 1;
}

.other-input-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: #f9f9f9;
    transition: border-color 0.3s ease;
    padding-right: 60px;
}

.other-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.other-char-counter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #888;
    font-weight: 500;
}

.form-group-wide {
    flex: 1;
}

.form-group-wide label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.wide-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: #f9f9f9;
    transition: border-color 0.3s ease;
}

.wide-select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.textarea-container {
    position: relative;
}

.textarea-container textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.textarea-container textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.textarea-container textarea::placeholder {
    color: #aaa;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8em;
    color: #888;
    font-weight: 500;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
}

.option-text {
    font-size: 0.95em;
    color: #333;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-option .checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.question #q3-answer {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
    background: #f9f9f9;
    transition: border-color 0.3s ease;
}

.question #q3-answer:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.ranking-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

#rankingContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.ranking-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: 600;
    margin-right: 12px;
    font-size: 0.85em;
    color: #666;
}

.ranking-item.selected .rank-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.item-text {
    flex: 1;
    font-size: 0.95em;
    color: #333;
}

.selected-ranking {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e8eaf0;
}

.selected-ranking.active {
    display: block;
}

.selected-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.selected-item {
    padding: 8px 0;
    font-size: 0.9em;
    color: #555;
}

.selected-rank {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-size: 0.8em;
    margin-right: 10px;
}

.button-container {
    text-align: center;
    margin-top: 35px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 45px;
    border-radius: 30px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.success-message {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-top: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 3em;
    color: white;
}

.success-message h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

.success-message p {
    color: #666;
    font-size: 1.1em;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    height: 180px;
}

.color-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.color-item input[type="radio"] {
    display: none;
}

.color-item input[type="radio"]:checked + img {
    border: 3px solid #667eea;
}

.color-item input[type="radio"]:checked ~ .no-image-text {
    background: #e8f4fd;
    border: 2px solid #667eea;
}

.color-item img {
    width: 100%;
    max-width: 100px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.color-name {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
}

.color-item.no-image {
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 10px;
    height: 180px;
}

.no-image-text {
    font-size: 0.7em;
    color: #666;
    text-align: center;
    padding: 15px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    width: calc(100% - 10px);
    box-sizing: border-box;
    overflow: visible;
    white-space: normal;
    max-height: 120px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.product-item input[type="checkbox"] {
    display: none;
}

.product-item img {
    width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-item input[type="checkbox"]:checked + img {
    border: 3px solid #667eea;
}

.product-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    form {
        padding: 25px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-item img {
        width: 70px;
        max-height: 70px;
        object-fit: contain;
    }
    
    .ranking-container,
    #rankingContainer {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ranking-item {
        padding: 12px 14px;
    }
    
    .item-text {
        font-size: 0.9em;
        line-height: 1.4;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .two-column-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .checkbox-option {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    
    .color-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    
    .product-item {
        padding: 10px;
    }
    
    .product-name {
        font-size: 0.85em;
    }
    
    .option-item {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}