/* =========================================================
   Architect Modal Forms — Alisti theme
   Изумрудный фон + золотой градиент акценты
   ========================================================= */

/* Локальные переменные — на случай если глобальные не подгружены */
.amf-modal {
    --amf-emerald-1: #0E4F4A;
    --amf-emerald-2: #0a3a36;
    --amf-emerald-3: #1a6b65;
    --amf-gold-1: #d4af37;
    --amf-gold-2: #f5d77a;
    --amf-gold-3: #b8902a;
    --amf-gold-grad: linear-gradient(135deg, #b8902a 0%, #d4af37 35%, #f5d77a 65%, #d4af37 100%);
    --amf-text-light: #f6efd9;
    --amf-text-muted: #cdbf95;
}

body.amf-modal-open {
    overflow: hidden;
}

.amf-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.amf-modal.is-active {
    display: block;
}

/* Бэкдроп — тёмный изумрудный с блюром, премиум */
.amf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 58, 54, 0.55);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Диалог — изумрудный фон + тонкая золотая рамка */
.amf-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(960px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    background:
        radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
        linear-gradient(160deg, var(--amf-emerald-1) 0%, var(--amf-emerald-2) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 18px;
    margin: 100px auto;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 175, 55, 0.1) inset;
    animation: amfFadeUp .25s ease;
}

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

/* Закрытие — золотая обводка, прозрачная заливка */
.amf-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    color: var(--amf-gold-2);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    z-index: 5;
    transition: all .25s ease;
    backdrop-filter: blur(5px);
}

.amf-modal-close:hover {
    background: var(--amf-gold-grad);
    color: var(--amf-emerald-2);
    border-color: var(--amf-gold-2);
    transform: rotate(90deg);
}

.amf-modal-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    align-items: center;
    padding: 28px 30px;
}

.amf-modal-media {
    text-align: center;
}

.amf-modal-image {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.amf-modal-body {
    width: 100%;
}

/* Маленький заголовок сверху — золотой капс */
.amf-modal-top-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--amf-gold-2);
    margin-bottom: 12px;
    opacity: .9;
}

/* Главный заголовок — золотой градиент (фирменная фишка Алисти) */
.amf-modal-title {
    margin: 0 0 16px;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 800;
    background: var(--amf-gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.amf-modal-description {
    font-size: 17px;
    line-height: 1.6;
    color: var(--amf-text-light);
    margin-bottom: 22px;
    opacity: .92;
}

.amf-modal-form-wrap {
    margin-top: 20px;
}

/* Предупреждение — отделяем тонкой золотой линией */
.amf-modal-warning {
    padding: 14px 22px 18px;
    margin: 0 30px 22px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--amf-text-muted);
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    text-align: center;
}

.amf-modal-warning-text {
    margin-bottom: 6px;
    opacity: .85;
}

.amf-modal-warning-links a {
    color: var(--amf-gold-2);
    text-decoration: none;
    font-weight: 600;
    transition: color .2s ease;
}

.amf-modal-warning-links a:hover {
    color: var(--amf-gold-1);
    text-decoration: underline;
}

/* Сообщение об успехе — изумрудный с золотой рамкой */
.amf-modal-success {
    margin-top: 16px;
    padding: 22px;
    border-radius: 14px;
    background: rgba(14, 79, 74, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.amf-modal-success-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--amf-gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.amf-modal-success-text {
    color: var(--amf-text-light);
    font-size: 16px;
}

/* Триггер-кнопка — золотой градиент с blur */
.amf-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 28px;
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-radius: 12px;
    background: var(--amf-gold-grad);
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.amf-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(212, 175, 55, 0.4);
    color: #1a1a1a;
    filter: brightness(1.05);
}

/* ===== Адаптив ===== */
@media (max-width: 767px) {
    .amf-modal-dialog {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 16px;
        margin: 8px auto;
    }

    .amf-modal-layout {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 24px 20px;
    }

    .amf-modal-warning {
        margin: 0 20px 20px;
    }

    .amf-modal-title {
        font-size: 28px;
    }

    .amf-modal-description {
        font-size: 15px;
    }

    .amf-modal-top-title {
        font-size: 12px;
    }
}

/* =========================================================
   Форма внутри модалки — Alisti стиль
   ========================================================= */

.form-modern {
    max-width: 500px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-group {
    width: 100%;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--amf-gold-2);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Инпуты — прозрачные с золотой рамкой */
.form-input-modal,
.amf-modal .wpcf7-form input[type="text"],
.amf-modal .wpcf7-form input[type="email"],
.amf-modal .wpcf7-form input[type="tel"],
.amf-modal .wpcf7-form input[type="url"],
.amf-modal .wpcf7-form input[type="number"],
.amf-modal .wpcf7-form input[type="date"],
.amf-modal .wpcf7-form textarea,
.amf-modal .wpcf7-form select {
    width: 100%;
    max-width: 360px;
    padding: 13px 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    font-size: 14px;
    color: var(--amf-text-light);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .25s ease;
    box-sizing: border-box;
}

.form-input-modal::placeholder,
.amf-modal .wpcf7-form input::placeholder,
.amf-modal .wpcf7-form textarea::placeholder {
    color: rgba(246, 239, 217, 0.45);
}

.form-input-modal:focus,
.amf-modal .wpcf7-form input:focus,
.amf-modal .wpcf7-form textarea:focus,
.amf-modal .wpcf7-form select:focus {
    border-color: var(--amf-gold-2);
    background: rgba(255, 255, 255, 0.07);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Сабмит формы — золотой градиент */
.form-button,
.form-modern button,
.amf-modal .wpcf7-form input[type="submit"],
.amf-modal .wpcf7-form button[type="submit"] {
    width: 100%;
    max-width: 360px;
    padding: 14px 24px;
    background: var(--amf-gold-grad);
    color: #1a1a1a;
    border: 1px solid var(--amf-gold-2);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .3s ease-in-out;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
}

.form-button:hover,
.form-modern button:hover,
.amf-modal .wpcf7-form input[type="submit"]:hover,
.amf-modal .wpcf7-form button[type="submit"]:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 14px 28px rgba(212, 175, 55, 0.4);
    color: #1a1a1a;
    background: var(--amf-gold-grad);
}

.form-agreement {
    font-size: 12px;
    color: var(--amf-text-muted);
    margin-top: 12px;
    text-align: center;
}

.form-agreement a {
    color: var(--amf-gold-2);
    text-decoration: underline;
}

/* CF7 ответы — спрячем родное и подадим аккуратно */
.amf-modal .wpcf7-response-output {
    display: none !important;
}

.amf-modal .wpcf7-not-valid-tip {
    color: #ffb4b4;
    font-size: 12px;
    margin-top: 6px;
}

.amf-modal .wpcf7-spinner {
    background-color: var(--amf-gold-2);
}