/*!
Theme Name: Ninth Systems Agent
Author: Ninth Systems Agent
Version: 1.0.0
Tested up to: 6.8.2
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: ninthsystemsagents
*/

.error404-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error404 {
  font-size: 30px;
}

.error404 h1 {
  text-align: center;
}

.error404 h1 span {
  color: #b774fe;
}

.error404 h1 a {
  color: #000;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  transition: .15s;
}

.error404 h1 a:hover {
  color: #b774fe;
}

@media ((min-width: 1100px) and (max-width: 1360px)) {
  .error404 {
    font-size: 22.5px;
  }
}

@media (max-width: 500px) {
  .error404 {
    font-size: 20px;
  }
}

/* Стили для Contact Form 7 */
.wpcf7-form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.wpcf7-text,
.wpcf7-email,
.wpcf7-textarea,
.wpcf7-select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    margin-bottom: 15px !important;
}

.wpcf7-textarea {
    min-height: 120px !important;
    resize: vertical !important;
}

.wpcf7-submit {
    width: 100% !important;
    padding: 15px !important;
    background: #007cba !important;
    color: white !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.wpcf7-submit:hover {
    background: #005a87 !important;
}

.wpcf7-form p {
    margin-bottom: 20px !important;
}

/* Стили попапа */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.popup-overlay:target {
    opacity: 1;
    visibility: visible;
}

/* Затемненная область вокруг формы */
.popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
    z-index: 1;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
    box-sizing: border-box;
    z-index: 2; /* Важно - форма должна быть выше затемнения */
}

.popup-overlay:target .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    text-decoration: none;
    display: block;
    width: 35px;
    height: 35px;
    text-align: center;
    z-index: 3;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: #ff0000;
}

.popup-form {
    width: 100%;
    box-sizing: border-box;
}

/* Блокировка прокрутки при открытом попапе */
body:has(.popup-overlay:target) {
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 768px) {
    .popup-content {
        padding: 30px 20px;
        width: 95%;
        max-width: 95%;
    }
    
    .popup-overlay {
        padding: 10px;
    }
    
    .wpcf7-text,
    .wpcf7-email,
    .wpcf7-textarea,
    .wpcf7-select {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    
    .wpcf7-submit {
        padding: 12px !important;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 25px 15px;
        border-radius: 10px;
    }
    
    .popup-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
}

/* Альтернатива для старых браузеров без :has */
.popup-overlay:target {
    position: fixed;
    overflow: hidden;
}