/*
 * Стили для форм и модальных окон
 * Автоломбард «Универсальный займ»
 */

/* Модальные окна (Popup Maker) */
.pum {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1999999998;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.pum.pum-active {
    display: flex;
}

.pum-container {
    position: relative;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    margin: 20px;
}

.pum-title {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 20px;
    text-align: center;
}

.pum-content {
    color: #777;
}

.pum-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pum-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Формы WPForms */
.wpforms-container {
    width: 100%;
}

.wpforms-form {
    margin: 0;
}

.wpforms-field-container {
    margin-bottom: 15px;
}

.wpforms-field {
    margin-bottom: 20px;
}

.wpforms-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.wpforms-field-label-hide {
    display: none;
}

.wpforms-required-label {
    color: #d9534f;
    font-weight: 700;
}

.wpforms-field input[type="text"],
.wpforms-field input[type="email"],
.wpforms-field input[type="tel"],
.wpforms-field input[type="url"],
.wpforms-field input[type="password"],
.wpforms-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.wpforms-field input[type="text"]:focus,
.wpforms-field input[type="email"]:focus,
.wpforms-field input[type="tel"]:focus,
.wpforms-field input[type="url"]:focus,
.wpforms-field input[type="password"]:focus,
.wpforms-field textarea:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.wpforms-field input.error,
.wpforms-field textarea.error {
    border-color: #d9534f;
}

.wpforms-field-large {
    font-size: 16px;
    padding: 14px 16px;
}

.wpforms-field-medium {
    font-size: 14px;
    padding: 12px 15px;
}

.wpforms-field-small {
    font-size: 13px;
    padding: 10px 12px;
}

/* Checkbox и Radio */
.wpforms-field-checkbox ul,
.wpforms-field-radio ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpforms-field-checkbox li,
.wpforms-field-radio li {
    margin-bottom: 10px;
}

.wpforms-field-checkbox input[type="checkbox"],
.wpforms-field-radio input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

.wpforms-field-label-inline {
    display: inline;
    font-weight: normal;
    cursor: pointer;
}

/* Honeypot (антиспам) */
.wpforms-field-hp {
    position: absolute !important;
    left: -9000px !important;
}

/* Кнопка отправки */
.wpforms-submit-container {
    margin-top: 25px;
    text-align: center;
}

.wpforms-submit,
button.wpforms-submit {
    display: inline-block;
    padding: 14px 40px;
    background-color: #333333;
    color: #fff;
    border: 2px solid #333333;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpforms-submit:hover,
button.wpforms-submit:hover {
    background-color: #555555;
    border-color: #555555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wpforms-submit:active,
button.wpforms-submit:active {
    transform: translateY(0);
}

/* Contact Form 7 */
.wpcf7 {
    width: 100%;
}

.wpcf7-form {
    margin: 0;
}

.wpcf7-form-control-wrap {
    display: block;
    position: relative;
}

.wpcf7-form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wpcf7-form-control:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.wpcf7-not-valid {
    border-color: #d9534f !important;
}

.wpcf7-validation-errors,
.wpcf7-response-output {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 14px;
}

.wpcf7-validation-errors {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wpcf7-mail-sent-ok {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wpcf7-submit {
    display: inline-block;
    padding: 14px 40px;
    background-color: #333333;
    color: #fff;
    border: 2px solid #333333;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpcf7-submit:hover {
    background-color: #555555;
    border-color: #555555;
}

/* Спиннер загрузки */
.wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    border: 3px solid rgba(51, 51, 51, 0.3);
    border-top-color: #333333;
    border-radius: 50%;
    animation: wpcf7-spin 0.8s linear infinite;
}

@keyframes wpcf7-spin {
    to { transform: rotate(360deg); }
}

/* Search Form */
.searchform,
.search-form {
    position: relative;
}

.search-field {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background-color: #333333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background-color: #555555;
}

/* Full Screen Search */
.full-screen-search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.full-screen-search-container.active {
    display: flex;
}

.full-screen-search-container .search-form {
    max-width: 600px;
    width: 90%;
}

.full-screen-search-container .search-field {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-size: 32px;
    padding: 10px 0;
    text-align: center;
}

.full-screen-search-container .search-field::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.full-screen-search-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.full-screen-search-close:hover {
    transform: rotate(90deg);
}

/* Адаптивность */
@media (max-width: 768px) {
    .pum-container {
        padding: 20px;
        width: 95%;
    }

    .pum-title {
        font-size: 20px;
    }

    .wpforms-submit,
    button.wpforms-submit,
    .wpcf7-submit {
        width: 100%;
        padding: 16px 20px;
    }

    .full-screen-search-container .search-field {
        font-size: 24px;
    }
}

/* Анимации для форм */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error {
    animation: shake 0.5s;
}

/* Accessibility */
.wpforms-field input:focus,
.wpforms-field textarea:focus,
.wpcf7-form-control:focus,
.search-field:focus {
    outline: 2px solid #333333;
    outline-offset: 2px;
}

/* Скрываем label, но оставляем для screen readers */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
