.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

/* Скрываем стандартную радиокнопку */
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Кастомная радиокнопка */
.radio-label span {
    position: relative;
    padding-left: 28px;
    line-height: 18px;
}

/* Внешний круг радиокнопки */
.radio-label span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    background-color: #fff;
    transition: all 0.2s ease;
}

/* Внутренний круг для выбранного состояния */
.radio-label span::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4CAF50;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Показываем внутренний круг при выборе */
.radio-label input[type="radio"]:checked + span::after {
    opacity: 1;
}

/* Стиль текста при выборе */
.radio-label input[type="radio"]:checked + span {
    font-weight: 700;
    color: #4CAF50;
}

/* Эффект при наведении */
.radio-label:hover span {
    color: #388E3C;
}

.radio-label:hover span::before {
    border-color: #388E3C;
    background-color: #e8f5e9;
}

/* Состояние фокуса для доступности */
.radio-label input[type="radio"]:focus + span::before {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}
/* Overlay для затемнения фона */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
    padding: 10px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

/* Само модальное окно */
.modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
    position: relative;
    transform: scale(0.8);
    animation: modalAppear 0.3s ease-out forwards;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: #ffffff;
    color: #2e7d32;
    padding: 20px 30px;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    padding-right: 60px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.close-btn {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.order-info {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.order-info h3 {
    color: #000000;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.order-info p {
    color: #555;
    margin: 4px 0;
    line-height: 1.4;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #000000;
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    background: #fafafa;
    color: #333333;
    box-sizing: border-box;
    min-height: 42px;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.08);
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.required {
    color: #f44336;
}

.submit-btn {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    max-width: 200px;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
    min-height: auto;
    display: block;
    letter-spacing: 0.01em;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #388e3c 0%, #4caf50 100%);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Чекбокс согласия на обработку данных */
.consent-group {
    margin: 1rem 0 1.25rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.consent-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-group label {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.5;
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.consent-group label a {
    color: #4caf50;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.consent-group label a:hover {
    color: #388e3c;
}

.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #4CAF50;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
    animation: slideIn 0.3s ease-out;
    line-height: 1.4;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Медиа-запросы для адаптива */

/* Планшеты */
@media screen and (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
    }
    
    .modal {
        max-width: 95%;
        margin: 0 auto;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 18px 24px;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-title {
        font-size: 1.35rem;
        padding-right: 50px;
    }
    
    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
        right: 18px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .order-info {
        padding: 14px;
        margin-bottom: 18px;
    }
    
    .order-info h3 {
        font-size: 0.95rem;
    }
    
    .order-info p {
        font-size: 0.85rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.7rem 0.85rem;
        font-size: 16px; /* Предотвращает zoom на iOS */
        min-height: 44px; /* Touch-friendly */
    }
    
    .consent-group {
        margin: 1rem 0;
    }
    
    .consent-group label {
        font-size: 0.75rem;
    }
    
    .consent-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .submit-btn {
        max-width: 220px;
        padding: 0.65rem 1.5rem;
        min-height: 44px;
    }
}

/* Мобильные устройства */
@media screen and (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 16px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 16px 18px;
        border-radius: 16px 16px 0 0;
        min-height: 56px;
    }
    
    .modal-title {
        font-size: 1.15rem;
        padding-right: 45px;
        line-height: 1.3;
    }
    
    .close-btn {
        width: 34px;
        height: 34px;
        font-size: 22px;
        right: 14px;
    }
    
    .modal-body {
        padding: 18px;
    }
    
    .order-info {
        padding: 14px;
        border-radius: 8px;
        margin-bottom: 18px;
    }
    
    .order-info h3 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .order-info p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 5px;
        font-weight: 500;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.75rem 0.9rem;
        font-size: 16px; /* Критично! Предотвращает zoom на iOS */
        border-radius: 8px;
        min-height: 48px; /* Touch-friendly */
        -webkit-appearance: none;
    }
    
    .form-group textarea {
        min-height: 100px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 14px;
    }
    
    .form-row .form-group {
        min-width: auto;
        margin-bottom: 0;
    }
    
    .consent-group {
        margin: 1.15rem 0;
        gap: 0.6rem;
    }
    
    .consent-group label {
        font-size: 0.75rem;
        line-height: 1.7;
    }
    
    .consent-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .submit-btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.875rem;
        min-height: 48px;
        max-width: 100%;
        width: 100%;
        border-radius: 30px;
        margin-top: 0.5rem;
    }
    
    .success-message {
        padding: 14px;
        font-size: 0.875rem;
        border-radius: 8px;
        line-height: 1.6;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .radio-label {
        font-size: 0.875rem;
    }
}

/* Очень маленькие экраны */
@media screen and (max-width: 360px) {
    .modal-overlay {
        padding: 8px;
        padding-top: 15px;
    }
    
    .modal {
        border-radius: 14px;
        max-height: calc(100vh - 30px);
    }
    
    .modal-header {
        padding: 14px 16px;
        border-radius: 14px 14px 0 0;
        min-height: 52px;
    }
    
    .modal-title {
        font-size: 1.05rem;
        padding-right: 40px;
    }
    
    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
        right: 12px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .order-info {
        padding: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.7rem 0.85rem;
        font-size: 16px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .modal-overlay {
        align-items: flex-start;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .modal {
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .modal-body {
        padding: 18px;
    }
    
    .form-group textarea {
        min-height: 80px;
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .form-group input,
    .form-group textarea,
    .form-group select,
    .submit-btn,
    .close-btn,
    .radio-label {
        -webkit-tap-highlight-color: rgba(76, 175, 80, 0.1);
    }
    
    .submit-btn:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
    }
    
    .submit-btn:active {
        transform: scale(0.98);
    }
    
    .close-btn:hover {
        background: transparent;
        color: #666;
    }
    
    .close-btn:active {
        background: #f5f5f5;
    }
    
    .consent-group input[type="checkbox"] {
        min-width: 18px;
        min-height: 18px;
    }
}