/* === SmartLicense (LCB) Frontend Styles === */

/* Базовые стили для контейнера и формы */
.lcb-container {
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease-in-out;
}

.lcb-form h2,
.lcb-form h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-weight: 600; /* Немного жирнее */
}
.lcb-form h4 {
    text-align: left;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 1.2em; /* Чуть крупнее подзаголовки секций */
}
.lcb-form hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 25px 0;
}


.lcb-form-group {
    margin-bottom: 15px;
    position: relative; /* Для позиционирования .required */
    /* Анимация появления */
    opacity: 0;
    transform: translateY(10px);
    animation: lcbFadeInUp 0.5s ease forwards;
}

/* Задержка анимации для последовательного появления */
.lcb-form-group:nth-child(1) { animation-delay: 0.1s; }
.lcb-form-group:nth-child(2) { animation-delay: 0.15s; }
.lcb-form-group:nth-child(3) { animation-delay: 0.2s; }
.lcb-form-group:nth-child(4) { animation-delay: 0.25s; }
.lcb-form-group:nth-child(5) { animation-delay: 0.3s; }
.lcb-form-group:nth-child(6) { animation-delay: 0.35s; }
/* ... добавьте для остальных полей, если нужно */
.lcb-submit-group { animation-delay: 0.5s; }


@keyframes lcbFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.lcb-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

/* Обязательное поле */
.lcb-form-group .required {
    color: #dc3545; /* Красный */
    font-weight: bold;
    margin-left: 3px;
}

.lcb-form-group input[type="text"],
.lcb-form-group input[type="email"],
.lcb-form-group input[type="url"],
.lcb-form-group input[type="number"],
.lcb-form-group input[type="file"], /* Стили для поля файла */
.lcb-form-group textarea,
.lcb-form-group select { /* Общие стили для полей ввода */
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    font-size: 14px; /* Базовый размер шрифта для полей */
    color: #333;
}

/* ---> ИСПРАВЛЕНИЕ ДЛЯ SELECT <--- */
.lcb-form-group select {
    height: auto; /* Убираем фиксированную высоту */
    line-height: normal; /* Нормальная высота строки для текста */
    -webkit-appearance: none; /* Убираем стандартный вид в Chrome/Safari/Edge */
    -moz-appearance: none; /* Убираем стандартный вид в Firefox */
    appearance: none; /* Стандартное свойство */
    /* Добавляем свою стрелку */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23555%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px auto;
    padding-right: 35px; /* Добавляем отступ справа, чтобы текст не заезжал под стрелку */
    cursor: pointer; /* Указываем, что это кликабельный элемент */
}
/* Убираем лишнюю рамку в Firefox */
.lcb-form-group select::-moz-focus-inner {
    border: 0;
}
/* Убираем стрелку в IE */
.lcb-form-group select::-ms-expand {
    display: none;
}
/* ---> КОНЕЦ ИСПРАВЛЕНИЯ ДЛЯ SELECT <--- */


.lcb-form-group input[type="file"] {
     padding: 5px 10px; /* Меньший вертикальный padding для file input */
     line-height: 1.4; /* Может помочь с выравниванием текста */
}

.lcb-form-group input:focus,
.lcb-form-group textarea:focus,
.lcb-form-group select:focus {
    border-color: #0073aa; /* WordPress Blue */
    outline: none;
    box-shadow: 0 0 0 1px #0073aa; /* Тонкая рамка при фокусе */
}

.lcb-form-group textarea {
    min-height: 90px; /* Чуть больше */
    resize: vertical;
}

.lcb-form-group small {
    font-size: 0.85em;
    color: #777;
    display: block;
    margin-top: 3px;
}

/* Группа чекбокса */
.lcb-checkbox-group label {
    display: inline-block;
    margin-left: 5px;
    font-weight: normal; /* Обычный шрифт для метки чекбокса */
    vertical-align: middle;
    cursor: pointer;
}
.lcb-checkbox-group input[type="checkbox"] {
    width: auto; /* Сброс ширины для чекбокса */
    vertical-align: middle;
    margin-right: 5px;
    cursor: pointer;
    position: relative; /* Для лучшего позиционирования */
    top: -1px; /* Небольшая коррекция по вертикали */
}

/* Стили для кнопки и лоадера */
.lcb-submit-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Перенос на мобильных */
    gap: 15px;
    margin-top: 25px; /* Больше отступ сверху */
}

.lcb-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa; /* WordPress Blue */
    color: #fff !important; /* Важно для переопределения стилей темы */
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500; /* Средняя жирность */
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    line-height: normal; /* Сброс line-height */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.lcb-button:visited {
    color: #fff !important; /* Цвет посещенной ссылки */
}

.lcb-button:hover,
.lcb-button:focus {
    background-color: #005a87;
    color: #fff !important;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.lcb-button:active {
    background-color: #004a70;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.lcb-button:disabled,
.lcb-button.lcb-button-disabled {
    background-color: #a0a5aa; /* Серый для неактивной */
    cursor: not-allowed;
    opacity: 0.7;
     box-shadow: none;
}

.lcb-button-secondary {
     background-color: #6c757d; /* Серый */
}
.lcb-button-secondary:hover,
.lcb-button-secondary:focus {
     background-color: #5a6268;
}
.lcb-button-secondary:active {
    background-color: #545b62;
}


.lcb-button-download {
     background-color: #28a745; /* Зеленый */
     margin-right: 10px;
     font-size: 14px;
     padding: 8px 15px;
}
.lcb-button-download:hover,
.lcb-button-download:focus {
     background-color: #218838;
}
.lcb-button-download:active {
    background-color: #1e7e34;
}


.lcb-loader {
    display: inline-block; /* Чтобы был рядом с текстом */
}
.lcb-loader img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.lcb-progress-text {
    font-style: italic;
    color: #555;
    vertical-align: middle;
    margin-left: 5px; /* Небольшой отступ от лоадера */
}


/* Стили для блока результатов */
.lcb-results-container {
    margin-top: 30px;
    padding: 25px; /* Чуть больше padding */
    border: 1px dashed #ccc;
    background-color: #fff;
    border-radius: 4px;
    animation: lcbFadeInResult 0.6s ease;
}
.lcb-results-container h3 {
    margin-top: 0;
    margin-bottom: 20px; /* Отступ под заголовком */
    color: #1d2327;
    font-size: 1.3em;
    text-align: center;
}


@keyframes lcbFadeInResult {
     from { opacity: 0; transform: translateY(10px); }
     to { opacity: 1; transform: translateY(0); }
}


#lcb-result-content {
    background-color: #f8f9fa; /* Светло-серый фон */
    border: 1px solid #e9ecef;
    padding: 20px; /* Больше padding */
    margin-bottom: 20px; /* Отступ снизу */
    max-height: 450px; /* Чуть больше высоты */
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.65; /* Немного больше межстрочный */
    color: #333;
    border-radius: 3px;
}

.lcb-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px; /* Отступ после блока копирования */
}

#lcb-copy-feedback {
    color: #28a745; /* Зеленый */
    font-weight: bold;
    font-size: 0.9em;
    margin-left: 5px; /* Отступ от кнопки */
}


.lcb-downloads,
.lcb-qr-code {
     margin-top: 20px;
     padding-top: 20px;
     border-top: 1px solid #eee;
}
.lcb-downloads h4,
.lcb-qr-code h4 {
    margin-top: 0;
    margin-bottom: 15px; /* Отступ под заголовками */
    font-size: 1.1em;
    font-weight: 600;
    text-align: left;
    border: none;
}
.lcb-downloads a {
    margin-bottom: 8px; /* Отступ для кнопок в столбик */
}


#lcb-qrcode-image {
    margin-bottom: 10px;
}
#lcb-qrcode-image img {
    display: block;
    max-width: 150px;
    height: auto;
    border: 1px solid #eee;
    padding: 5px;
    background: #fff;
    border-radius: 3px;
}
.lcb-qr-code small {
     font-size: 0.85em;
     color: #777;
     display: block;
     margin-bottom: 8px; /* Отступ под описанием QR */
}
.lcb-qr-code a {
    font-size: 0.9em;
    margin-right: 15px; /* Больше отступ между ссылками */
    display: inline-block;
    text-decoration: none;
    color: #0073aa;
    transition: color 0.2s ease;
}
.lcb-qr-code a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Блок ошибок */
#lcb-error-container {
    color: #721c24; /* Темно-красный для текста */
    background-color: #f8d7da; /* Светло-розовый фон */
    border: 1px solid #f5c6cb; /* Розовая рамка */
    padding: 15px 20px;
    border-radius: 4px;
    margin-top: 20px;
    animation: lcbFadeInResult 0.5s ease; /* Та же анимация */
}
#lcb-error-container p,
#lcb-error-container div { /* Для сообщений, обернутых в div */
     margin: 0 0 5px 0; /* Отступы между строками ошибок */
     padding: 0;
     font-size: 0.95em;
}
#lcb-error-container p:last-child,
#lcb-error-container div:last-child {
    margin-bottom: 0;
}


/* Адаптивность */
@media (max-width: 768px) {
    .lcb-form h2 {
        font-size: 1.5em; /* Уменьшаем заголовок на средних экранах */
    }
}

@media (max-width: 600px) {
    .lcb-container {
        padding: 15px;
    }
    .lcb-form h2 {
        font-size: 1.3em;
    }
    .lcb-form h4 {
        font-size: 1.1em;
    }
    .lcb-button {
        font-size: 14px;
        padding: 10px 15px;
    }
    /* Кнопки могут стать в столбик из-за flex-wrap */
     .lcb-submit-group,
     .lcb-actions {
          gap: 10px; /* Меньше разрыв */
     }
     .lcb-downloads a {
          display: block;
          margin-bottom: 10px; /* Больше отступ для кнопок в столбик */
          margin-right: 0;
          text-align: center; /* Центрируем текст на кнопках */
     }
     #lcb-result-content {
        max-height: 350px; /* Меньше высота на мобильных */
        padding: 15px;
     }
     .lcb-results-container {
         padding: 20px;
     }
     .lcb-qr-code a {
        margin-right: 10px;
        margin-bottom: 5px; /* Отступ для ссылок под QR */
     }
}