/* Базовые стили для формы */
form * {
    font-family: "Nunito Sans", sans-serif;
}

*::placeholder {
    opacity: 1;
    color: var(--primary-color);
}

/* Стили для меток (labels) */
label {
    display: block;    
    font-weight: 700!important;
    font-size: 16px;    
    margin: 2px 0px 8px 2px;
}


label span {
    font-weight: 400!important;
    font-size: 0.94rem;
    color:var(--secondary-text);
}

label i {
    font-style: normal;
    cursor: pointer;
}


.required {
    font-weight: 700;
    font-size: 18px;
}


/* Стили для полей ввода */
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    margin: 0px;
    border: 1px solid var(--modal-border);
    border-radius: 3px;    
    background-color: var(--background);
    color: var(--text-color);
    font-size: 16px;
    font-family: "Nunito Sans", sans-serif;    
    outline: none;

}


input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
select,
textarea {
    margin-bottom: 15px;
}




textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 1px;
} 


/* Стили для кнопок */


button,
.button,
.altbutton,
.btn {
    display: inline-block;
}

button,
input[type="reset"],
input[type="button"],
.btn,
.btn:hover,
input[type="submit"] {

    margin: 0px;
    margin-bottom: 15px;
    white-space: nowrap;



    display: inline-block;
    padding: 10px 20px;
    background-color: var(--button-primary-bg);
    color: var(--button-primary-text);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px !important;
    text-align: center;
    text-decoration: none;
    font-weight: 500;    
    outline: none;
}

button:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
.btn:hover,
input[type="submit"]:hover {
    background-color: var(--button-primary-hover);
    border-color: var(--button-primary-border-hover);
}



.button:active,
input[type="reset"]:active,
input[type="button"]:active,
.btn:active,
input[type="submit"]:active {
    background-color: var(--button-primary-active);
    /* Еще темнее при нажатии */
    transform: scale(0.98);
    /* Легкий эффект "нажатия" */
}

button:focus,
input[type="reset"]:focus,
input[type="button"]:focus,
.btn:focus,
input[type="submit"]:focus {
    
    /*box-shadow: 0 0 0 3px var(--primary-color);*/
    /* Синяя подсветка для доступности */

    outline: 0px solid var(--babr-color);
    outline-offset: 2px;

}


button:focus-visible,
input[type="reset"]:focus-visible,
input[type="button"]:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible {
    /*
    box-shadow: 0 0 0 3px var(--primary-color);*/
    /* Синяя подсветка для доступности */

    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}



.altbutton {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;    
    /*background-color: var(--button-secondary-bg) !important;*/
    background-color: transparent !important;
    color: var(--button-primary-text);
    border: 1px solid var(--button-border);
}


.altbutton:hover {
    background-color: var(--button-primary-hover) !important;
    text-decoration: none;
}

.altbutton:active {
    background-color: var(--button-primary-active) !important;
    text-decoration: none;
    outline: 2px solid var(--modal-border);
}




/* спец кнопки */


.redbutton {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;    
    background-color: var(--redbutton-bg) !important;
    color: var(--redbutton-text);
}


.redbutton:hover {
    background-color: var(--redbutton-hover-bg) !important;
    text-decoration: none;
    transform: scale(0.98);
}

.redbutton:focus {
    outline: 3px solid var(--babr-color);
    outline-offset: 2px;
}

/*тонкая кнопка*/
.slim {
    padding: 6px 12px !important;
}

/*кнопка без отступов (потоковая)*/
.inline {
    margin: 0 ! important;
}

.follow {
    background-color: #8B9931;
    color: #fff;
}

.follow:hover {
    background-color: #A0AF4B;
}

.premium {}



.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #95a5a6;
    padding: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: var(--button-secondary-hover);
    color: var(--button-secondary-text);
}





.addphoto img {
    height: 24px;
    width: 24px;
    background: url(../icons/addphoto.svg) center / 24px 24px no-repeat;

}

.button-float {
    border-radius: 100px;
    bottom: 40px;
    position: fixed;
    right: 20px;    
    z-index: 9;
    width: 60px !important;
    height: 60px !important;
}


/* Стили для чекбоксов и радиокнопок */
input[type="checkbox"],
input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;    
    margin-bottom: 14px;
    margin-left: 5px;
    outline-offset: 3px;

}

/* Фокус на чекбоксах и радиокнопках */
input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Подписи к чекбоксам и радиокнопкам */
input[type="checkbox"]+label,
input[type="radio"]+label {
    display: flex;
    align-items: center;
    /* Выравниваем текст и элемент по центру */
    font-weight: normal;
    /* Убедимся, что шрифт обычный */   
}

/* Ошибки для всех элементов */

.error {
    border-bottom: 1px solid var(--danger) !important;
}

.error:focus {
    outline: 3px solid var(--danger);
    outline-offset: 2px;
    border-bottom: 1px solid var(--modal-border) !important;

}

input[type="checkbox"].error,
input[type="radio"].error {
    outline: 1px solid var(--danger);
}


input[type="checkbox"].error:focus,
input[type="radio"].error:focus {
    outline: 3px solid var(--danger);
}




/* Текстовая подсказка для ошибок */
.error-message {
    color: var(--danger);
    font-size: 15px;
    margin: -10px 0px 15px 2px;
    
    display: block;
}








/* Обнуляющий стиль для уникальных форм */
.reset-form {
    all: unset;
    /* Полный сброс всех стилей */
    margin: 0;
    padding: 0;
    border: none;
    font-family: inherit;
    /* Наследуем шрифт родителя */
    font-size: inherit;
    /* Наследуем размер шрифта */
    color: inherit;
    /* Наследуем цвет текста */
    background: none;
    /* Убираем фон */
}

.reset-form * {
    all: unset;
    /* Сбрасываем стили для всех дочерних элементов */
    margin: 0;
    padding: 0;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
}

.reset-form input,
.reset-form select,
.reset-form textarea,
.reset-form button {
    display: inline-block;
    /* Для форм-элементов восстанавливаем inline-block */
    margin: 0;
    padding: 0;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    box-shadow: none;
    outline: none;
}



.round {
    appearance: none;
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    cursor: pointer;
    margin: auto;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;

}


/*стили для паролей*/

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-80%);
    cursor: pointer;
    user-select: none;
}



/* Стили для формы поиска */

.search-wrapper {
    flex: 1;
    margin: 0 20px;
    max-width: 800px;
}

.search-wrapper .search-form {
    display: flex;
    transition: all 0.5s;
    border-radius: 6px;
    outline: 0px;
    align-items: center;
    align-items: stretch;


}

.search-wrapper .search-form input {
    flex: 1;
    padding: 8px;
    outline: 0px;
    outline-offset: 0;
    border-radius: 4px 0 0 4px;
    border: 1px solid var(--modal-border);
    border-right-width: 0px;
    background: var(--search-bg);
}

.search-wrapper .search-form input::placeholder {
    color: var(--search-placeholder);
}


.search-wrapper .altbutton:hover {
    color: var(--search-button-hover);
}

.search-wrapper .altbutton:focus {
    color: var(--search-button-active);
}

.search-wrapper .altbutton {
    color: var(--search-button);
    border: 1px solid var(--modal-border);
    border-left-width: 0px;
}

.search-wrapper button {
    padding: 6px 12px;
    outline: 0px;
    outline-offset: 0;
    background: var(--button-primary-bg);
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    display: inline-flex;
}

.search-wrapper .search-form button img {
    width: 24px;
    height: auto;
}

.search-wrapper .search-form button:hover {
    background-color: var(--button-primary-hover);
}

.search-wrapper .search-form button:focus {
    background-color: var(--button-primary-hover);
}

.search-wrapper #search input:focus {
    outline: 0;
    border: 0;
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
}


.search-wrapper .search-toggle {
    display: none;
    /* Скрыт на десктопе */
}


.search-wrapper .search-toggle img {
    height: 24px;
    width: auto;
    background: url(../icons/search_button.svg) center / 24px 24px no-repeat;
}

/*
.search-wrapper .search-toggle img:hover {
    background: url(../icons/search_button_h.svg) center / 28px 28px no-repeat; 
}
*/

/* Крестик закрытия */
.search-wrapper .search-close {
    display: none;
    /* Скрыт по умолчанию (на десктопе) */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.search-wrapper .search-close:hover .icon,
.search-wrapper .search-close:focus .icon {
    opacity: 0.8;
    /* Лёгкий эффект */
}



input[type="search"]::-webkit-search-cancel-button {
    appearance: none;
    /* Убираем исходный стиль */
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    /* Размеры кнопки */
    background: url(../icons/close.svg) center / 24px 24px no-repeat;
    /* Картинка */
    cursor: pointer;
}

/* Для Internet Explorer и Edge (устаревший движок EdgeHTML) */
/* В современных Edge на Chromium этот псевдоэлемент может не потребоваться, 
   но для совместимости с IE стоит добавить */
input[type="search"]::-ms-clear {
    display: none;
    /* Часто в IE его просто скрывают */
    width: 0;
    height: 0;
}







/* Responsive: для экранов < 768px */
@media (max-width: 768px) {


    form {
        max-width: 90vw;
    }


    .search-wrapper {
        margin: 0 0px;
        overflow: hidden;
    }

    .search-wrapper .search-form {
        display: none;
        /* Скрываем поиск */
        position: absolute;
        top: 4px;
        right: 0;
        background: var(--header-bg);
        z-index: 10;
        /* Поверх других элементов, кроме логотипа */
    }

    .search-wrapper.active .search-form {
        display: flex;
        width: calc(100% - 68px);
        /* Логотип остаётся visible */
        padding: 5px 0px;
    }

    .search-wrapper .search-toggle {
        display: flex;
        /* Показываем иконку */
    }


    .search-wrapper .search-close {
        display: block;
        /* Показываем */
        background: none !important;
    }

    .search-wrapper .search-form button {
        padding: 8px;
    }



}