:root {
    --color-w: #ffffff;
    --color-1: #719178;
    --color-2: #EAD7A1;
    --color-3: #A8BAA4;
    --color-4: #3F575B;
    --font-main: 'Advent Pro', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #ffffff;
    min-height: 100vh;
    font-family: var(--font-main);
    padding-top: 80px;
}

.main-container {
    width: 1500px;
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

.courses-section {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 0;
}

.courses-title {
    font-family: var(--font-main);
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--color-4);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.courses-subtitle {
    font-family: var(--font-main);
    font-size: 1.3rem;
    color: #666;
    text-align: center;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    justify-content: center;
    padding: 20px 0;
}

.course-card {
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(63, 87, 91, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--color-2);
    height: 100%;
    display: flex;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(63, 87, 91, 0.2);
    border-color: var(--color-1);
}

.course-card-inner {
    padding: 30px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.course-level {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 400;
    background: var(--color-3);
    color: var(--color-4);
}

.course-level.beginner {
    background: var(--color-2);
    color: var(--color-4);
}

.course-level.intermediate {
    background: var(--color-3);
    color: var(--color-4);
}

.course-level.advanced {
    background: var(--color-1);
    color: white;
}

.course-description {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

.course-details {
    background: var(--color-3);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.course-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
}

.detail-icon {
    font-size: 1.5rem;
}

.detail-text {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-4);
}

.course-program {
    margin-bottom: 20px;
}

.course-program h3 {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-4);
    margin-bottom: 10px;
}

.course-program ul {
    list-style: none;
    padding: 0;
}

.course-program li {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: #666;
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.course-program li::before {
    content: '✓';
    color: var(--color-1);
    position: absolute;
    left: 0;
}

.course-footer {
    margin-top: auto;
}

.course-btn {
    width: 100%;
    padding: 15px;
    background: var(--color-1);
    color: white;
    border: none;
    border-radius: 15px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-btn:hover {
    background: var(--color-4);
    transform: scale(1.02);
}
/* Кнопки выбора формата */
.course-format {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.format-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--color-2);
    border-radius: 15px;
    background: white;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-btn:hover {
    background: var(--color-2);
    transform: translateY(-2px);
}

.format-btn.active {
    background: var(--color-1);
    border-color: var(--color-1);
    color: white;
}

.format-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
    background: #f0f0f0;
    border-color: #ccc;
}

.format-btn.disabled:hover {
    background: #f0f0f0;
    transform: none;
}

.format-btn.disabled:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-4);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    margin-bottom: 10px;
    z-index: 10;
}

.format-unavailable {
    background: #fee;
    border: 1px solid #faa;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

.unavailable-message {
    color: #c00;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.unavailable-message::before {
    content: '⚠️';
    margin-right: 8px;
}

.price {
    font-weight: 600;
    color: var(--color-1);
}

.course-btn {
    width: 100%;
    padding: 15px;
    background: var(--color-1);
    color: white;
    border: none;
    border-radius: 15px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-btn:hover:not(:disabled) {
    background: var(--color-4);
    transform: scale(1.02);
}

.course-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}
@media screen and (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 800px) {
    .main-container {
        padding: 20px 15px;
    }
    
    .courses-title {
        font-size: 2.8rem;
    }
    
    .courses-subtitle {
        font-size: 1.2rem;
        margin-bottom: 40px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .course-card-inner {
        padding: 25px;
    }
    
    .course-title {
        font-size: 1.6rem;
    }
    
    .course-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
}

@media screen and (max-width: 500px) {
    .courses-title {
        font-size: 2.3rem;
    }
    
    .courses-subtitle {
        font-size: 1.1rem;
    }
    
    .course-card-inner {
        padding: 20px;
    }
    
    .course-title {
        font-size: 1.5rem;
    }
    
    .course-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .course-detail {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
}

@media screen and (max-width: 350px) {
    .course-card-inner {
        padding: 15px;
    }
    
    .course-title {
        font-size: 1.3rem;
    }
    
    .course-btn {
        padding: 12px;
        font-size: 1rem;
    }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 40px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 30px 60px rgba(63, 87, 91, 0.3);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-3);
    border: none;
    font-size: 24px;
    color: var(--color-4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--color-2);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.modal-title {
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--color-4);
    line-height: 1.3;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-4);
    margin-left: 5px;
}

.form-label .optional {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.85rem;
}

.form-input {
    padding: 15px 20px;
    border: 2px solid var(--color-2);
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-1);
    box-shadow: 0 5px 15px rgba(113, 145, 120, 0.2);
}

.form-input::placeholder {
    color: #aaa;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.phone-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phone-prefix {
    padding: 15px 20px;
    background: var(--color-3);
    border: 2px solid var(--color-2);
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-4);
    min-width: 70px;
    text-align: center;
}

.phone-number {
    flex: 1;
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: var(--color-3);
    color: var(--color-4);
    border: 2px solid var(--color-2);
}

.btn-cancel:hover {
    background: var(--color-2);
    transform: translateY(-2px);
}

.btn-submit {
    background: var(--color-1);
    color: white;
}

.btn-submit:hover {
    background: var(--color-4);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(63, 87, 91, 0.3);
}

input#phone {
    letter-spacing: 2px;
}

@media screen and (max-width: 500px) {
    .modal-container {
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .phone-input {
        flex-direction: column;
    }
    
    .phone-prefix {
        width: 100%;
    }
}
.format-error {
    background: #fee;
    border: 2px solid #faa;
    border-radius: 15px;
    padding: 12px 20px;
    margin: 15px 0;
    text-align: center;
    font-family: var(--font-main);
    color: #c00;
    font-size: 1rem;
    font-weight: 500;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); background: var(--color-2); }
}

.format-btn.pulse {
    animation: pulse 1s ease;
}

.course-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
    position: relative;
}

.course-btn:disabled:hover::after {
    content: 'Сначала выберите формат';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-4);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    margin-bottom: 10px;
    z-index: 10;
}