/* ============================================================
   INOVIS — Contacts page styles (новая вёрстка)
   assets/css/contacts-new.css
   ============================================================ */

.contacts-page h1.page-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px; font-weight: 400; line-height: 38px;
    color: #f8f9fa;
    padding: 0 0 30px;
    margin: 0;
}

/* ---- Contact info row ----
   Левый блок (телефоны/email) | 1px divider | Адрес + лого
   Разделитель прижат к левому блоку, не по центру */
.contact-info-row {
    display: grid;
    grid-template-columns: max-content 1px 1fr;
    gap: 0;
    padding-bottom: 40px;
    align-items: center;
}

.contact-left {
    display: flex; flex-direction: column;
    gap: 12px;
    padding-right: 80px;
    width: fit-content;
}

.contact-col-divider {
    background: rgba(255, 255, 255, 0.2);
    align-self: stretch;
    flex-shrink: 0;
}

.contact-right {
    padding-left: 80px;
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.contact-item {
    display: flex; align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #1dcfed;
    letter-spacing: -0.16px;
    text-decoration: none;
    white-space: nowrap;
    width: fit-content;
}

.contact-item svg {
    flex-shrink: 0;
    display: block;
}

.contact-address {
    font-size: 16px; line-height: 24px;
    color: #f8f9fa;
    letter-spacing: -0.16px;
    flex: 1;
}

.contact-address strong {
    display: block;
    color: #f8f9fa;
    font-weight: 400;
    margin-bottom: 0;
}

.contact-logo-img {
    width: 243px;
    height: auto;
    flex-shrink: 0;
    display: block;
}

/* ---- Form subtitle ---- */
.form-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px; font-weight: 400; line-height: 38px;
    color: #f8f9fa;
    margin-bottom: 36px;
}

/* ---- CF7 Form ----
   CF7 рендерит поля в <p> тегах по умолчанию.
   Мы оборачиваем содержимое в .contacts-fields-grid через шаблон.
   Здесь сбрасываем все браузерные стили полей. */

.contacts-cf7-wrap .wpcf7 {
    width: 100%;
}

/* Сетка полей — управляется через HTML-обёртки в шаблоне */
.contacts-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

/* Звёздочка рядом с placeholder через псевдоэлемент */
.cf7-field.required input::placeholder,
.cf7-field.required textarea::placeholder {
    color: #9a9a9a !important;
}

/* Overlay-label со звёздочкой — позиционируется поверх input */
.cf7-field-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #9a9a9a;
    user-select: none;
    position: absolute;
    left: 0;
    top: 14px;
    padding-left: 13px;
    z-index: 1;
}

.cf7-required-star {
    color: #ff4444;
    font-size: 12px;
    vertical-align: super;
    margin-left: 1px;
}

.cf7-field {
    display: flex; flex-direction: column;
    padding: 0 12px 16px;
    border-bottom: 1px solid #9a9a9a;
    margin-bottom: 16px;
    position: relative;
}

/* Label со звёздочкой для обязательных полей */
.cf7-field-label {
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #9a9a9a;
    padding-top: 14px;
    pointer-events: none;
    user-select: none;
}

.cf7-required-star {
    color: #ff4444;
    font-size: 14px;
    line-height: 1;
    vertical-align: super;
}

.cf7-field-full {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

/* Сбрасываем все браузерные стили для полей внутри обёртки */
.contacts-cf7-wrap input[type="text"],
.contacts-cf7-wrap input[type="email"],
.contacts-cf7-wrap input[type="tel"],
.contacts-cf7-wrap textarea {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    line-height: 24px !important;
    color: #f8f9fa !important;
    padding: 14px 0 4px !important;
    width: 100% !important;
    resize: none !important;
    display: block !important;
    -webkit-appearance: none !important;
}

.contacts-cf7-wrap input[type="text"]::placeholder,
.contacts-cf7-wrap input[type="email"]::placeholder,
.contacts-cf7-wrap input[type="tel"]::placeholder,
.contacts-cf7-wrap textarea::placeholder {
    color: #9a9a9a !important;
    opacity: 1 !important;
}

.contacts-cf7-wrap textarea { min-height: 240px; }

/* Span-обёртки CF7 */
.contacts-cf7-wrap .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* Autofill override */
.contacts-cf7-wrap input:-webkit-autofill,
.contacts-cf7-wrap input:-webkit-autofill:hover,
.contacts-cf7-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #080a16 inset !important;
    -webkit-text-fill-color: #9a9a9a !important;
}

/* CF7 validation */
.contacts-cf7-wrap .wpcf7-not-valid-tip {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
}

.contacts-cf7-wrap .wpcf7-response-output {
    font-size: 14px;
    padding: 10px;
    margin: 16px 0 0;
    border-radius: 6px;
}

.contacts-cf7-wrap .wpcf7-spinner { display: none; }

/* Скрываем нативную CF7 кнопку submit — используем нашу */
.contacts-cf7-wrap .wpcf7-submit {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    pointer-events: none;
}

/* ---- Agree row ---- */
.cf7-agree-row {
    display: flex; align-items: center;
    gap: 12px;
    margin: 24px 0;
    font-family: 'Heebo', 'Segoe UI', sans-serif;
    font-size: 14px; line-height: 28px;
    color: #f8f9fa;
    justify-content: center;
}

/* Custom checkbox */
.cf7-checkbox {
    width: 20px; height: 20px;
    border: 1px solid rgba(234, 234, 241, 0.2);
    border-radius: 3px;
    flex-shrink: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.cf7-checkbox.checked {
    border-color: #1dcfed;
    background: rgba(29, 207, 237, 0.1);
}

.cf7-checkbox.checked::after {
    content: '✓';
    color: #1dcfed;
    font-size: 12px; line-height: 1;
}

.terms-link {
    color: #1dceed;
    cursor: pointer;
    text-decoration: none;
}
.terms-link:hover { color: #01d7fc; text-decoration: underline; }

/* ---- Submit ---- */
.cf7-submit-row {
    display: flex; justify-content: center;
}

.cf7-submit-btn {
    background: #10162a;
    border: 1px solid rgba(192, 212, 237, 0.85);
    border-radius: 10px;
    padding: 16px 71px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px; line-height: 24px;
    color: #f8f9fa;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.cf7-submit-btn:hover:not(:disabled) { background: #1a2240; }

.cf7-submit-btn:disabled {
    opacity: 0.4; cursor: not-allowed;
}

/* ---- Terms Modal ---- */
.terms-modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0, 0, 0, 0.5);
    align-items: center; justify-content: center;
    padding: 20px;
}

.terms-modal-overlay.open { display: flex; }

.terms-modal-box {
    background: #0a0d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 660px; max-width: 100%; max-height: 85vh;
    position: relative;
    padding: 50px 80px 60px 80px;
    overflow-y: auto;
    isolation: isolate;
}

/* Бегущий огнёк по периметру */
@property --modal-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes modal-border-spin {
    to { --modal-angle: 360deg; }
}

.terms-modal-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(rgba(29,207,237,0.28) 0%, rgba(29,207,237,0) 100%), rgba(29,207,237,0.10);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.terms-modal-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--modal-angle),
        transparent 0%, transparent 28%,
        rgba(29,207,237,0.12) 33%, rgba(29,207,237,0.42) 36%,
        rgba(29,207,237,0.95) 39%, rgba(2,146,182,0.98) 43%,
        rgba(2,146,182,0.38) 46%, rgba(2,146,182,0.12) 49%,
        transparent 54%, transparent 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .88;
    filter: drop-shadow(0 0 4px rgba(29,207,237,0.28)) drop-shadow(0 0 10px rgba(29,207,237,0.18));
    animation: modal-border-spin 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.terms-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none; border: none; cursor: pointer;
    color: #f8f9fa;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1;
    transition: color 0.2s;
    z-index: 1;
    flex-shrink: 0;
}

.terms-modal-close:hover { color: #1dcfed; }

.terms-modal-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px; line-height: 27px;
    color: #f8f9fa;
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {
    .contacts-page h1.page-title { font-size: 22px; padding: 0 0 20px; }
    .form-subtitle { font-size: 18px; margin-bottom: 20px; }

    .contact-info-row { grid-template-columns: 1fr; gap: 20px; }
    .contact-col-divider { display: none; }
    .contact-left { padding-right: 0; width: auto; }
    .contact-right { padding-left: 0; flex-wrap: wrap; gap: 20px; }

    .contacts-fields-grid { grid-template-columns: 1fr; gap: 0; }
    .cf7-field { padding: 0 0 12px; }
    .cf7-field-label { padding-left: 0; }

    .terms-modal-box { padding: 50px 20px 30px; width: 100%; border-radius: 12px; }
    .terms-modal-close { top: 12px; right: 12px; }
    .terms-modal-text { font-size: 15px; line-height: 24px; }
}

/* Лого на отдельной строке начиная с 480px */
@media (max-width: 480px) {
    .contact-right {
        flex-direction: column;
        align-items: flex-start;
    }
    .contact-logo-img {
        width: 160px;
        margin: 0;
    }
}
