/* =========================
   МОДАЛЬНОЕ ОКНО
========================= */

.modal {
    display: none;
}

.modal.is-open {
    display: block;
}

.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 12px;
    box-sizing: border-box;
}

.modal__container {
    position: relative;
    background-color: #fff;
    width: 100%;
    max-width: 440px;
    padding: 18px;
    border-radius: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.modal__header {
    min-height: 16px;
    position: relative;
}

.modal__close {
    background: transparent;
    border: 0;
    position: absolute;
    top: -4px;
    right: -4px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal__close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.modal__content {
    padding: 8px 0 0;
    line-height: 1.5;
    color: #555;
}

.modal__footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.modal__btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.modal__btn-primary {
    background: #007bff;
}

.modal__btn:hover {
    opacity: 0.8;
}

/* =========================
   АНИМАЦИЯ MICROMODAL
========================= */

.micromodal-slide {
    display: none;
}

.micromodal-slide.is-open {
    display: block;
}

.micromodal-slide[aria-hidden="false"] .modal__overlay {
    animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal__container {
    animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__overlay {
    animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__container {
    animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide .modal__container,
.micromodal-slide .modal__overlay {
    will-change: transform;
}

@keyframes mmfadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes mmfadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes mmslideIn {
    from {
        transform: translateY(15%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes mmslideOut {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10%);
    }
}

/* =========================
   ФОРМА
========================= */

.compact-form,
#feedbackForm,
.consultation-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}



.form-group {
    margin: 0;
}

.form-label {
    display: none;
}

.form-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d9dce3;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-size: 14px;
    line-height: 1.35;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input::placeholder {
    color: #8c93a3;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.form-textarea,
textarea.form-input {
    min-height: 82px;
    resize: vertical;
}

.form-input-file,
input[type="file"].form-input {
    min-height: auto;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.3;
    background: #fafbfc;
    cursor: pointer;
}

.form-note,
.form-hint {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #7d8597;
}

.submit-btn,
.compact-submit-btn {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #5a67d8);
    transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.22);
}

.submit-btn:hover,
.compact-submit-btn:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.submit-btn:disabled,
.compact-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =========================
   ЧЕКБОКС
========================= */

.form-group-checkbox,
.compact-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 2px;
}

.checkbox-wrapper {
    flex: 0 0 auto;
    padding-top: 2px;
}

.form-checkbox,
.callback-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #667eea;
    cursor: pointer;
}

.checkbox-label,
.compact-checkbox-label {
    display: block;
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #666;
}

.checkbox-label a,
.compact-checkbox-label a {
    color: #667eea;
    text-decoration: none;
}

.checkbox-label a:hover,
.compact-checkbox-label a:hover {
    text-decoration: underline;
}

/* =========================
   ВАЛИДАЦИЯ И СООБЩЕНИЯ
========================= */

.has-danger .form-input {
    border-color: #d93025;
    box-shadow: none;
}

.has-success .form-input {
    border-color: #1f9d55;
}

.text-help,
.form-message {
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

.text-help {
    color: #d93025;
}

.form-message {
    margin-top: 6px;
}

.form-message--error {
    color: #d93025;
}

.form-message--success {
    color: #188038;
}

/* =========================
   СООБЩЕНИЕ ОБ УСПЕХЕ
========================= */

.success-message {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    padding: 22px 16px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.25);
    animation: slideInUp 0.4s ease-out;
    margin: 12px 0 0;
}

.success-message .success-icon {
    background: rgba(255, 255, 255, 0.18);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 12px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    color: green;
}

.success-message h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.success-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.96;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content .success-message {
    margin: 0;
    border-radius: 8px;
}

/* =========================
   АДАПТИВНОСТЬ ПО ВЫСОТЕ
========================= */

@media (max-height: 600px) {
    .modal__container {
        max-height: 95vh;
    }

    .modal__content {
        max-height: calc(95vh - 60px);
    }
}

@media (max-height: 400px) {
    .modal__container {
        max-height: 100vh;
        border-radius: 0;
    }

    .modal__content {
        max-height: calc(100vh - 50px);
    }
}

/* =========================
   МОБИЛЬНАЯ ВЕРСИЯ
========================= */

@media (max-width: 600px) {
    .success-message {
        padding: 20px 14px;
        margin: 10px 0 0;
    }

    .success-message .success-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
        margin-bottom: 12px;
    }

    .success-message h3 {
        font-size: 18px;
    }

    .success-message p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal__overlay {
        padding: 8px;
    }

    .modal__container {
        max-width: 100%;
        padding: 14px;
        border-radius: 10px;
    }

    .modal__close {
        top: -2px;
        right: -2px;
    }

    .modal__content {
        padding-top: 6px;
    }

    .form-input {
        font-size: 14px;
        padding: 10px 11px;
    }

    .form-textarea,
    textarea.form-input {
        min-height: 74px;
    }

    .checkbox-label,
    .compact-checkbox-label {
        font-size: 11px;
    }

    .submit-btn,
    .compact-submit-btn {
        min-height: 40px;
        font-size: 14px;
    }
}

/* =========================
   ТЕМНАЯ ТЕМА
========================= */

@media (prefers-color-scheme: dark) {
    .success-message {
        background: linear-gradient(135deg, #2e7d33, #388e3c);
    }
}


.success-message--inside-form {
    margin: 0;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}