/* style-optimized.css - Оптимизированный CSS файл с улучшенной доступностью */

/* CSS Variables with improved contrast */
:root {
    --primary-blue: #0d47a1;
    --medium-blue: #1565c0;
    --light-blue: #1976d2;
    --accent-orange: #e65100;
    --dark-orange: #bf360c;
    --star-gold: #ff8f00;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #424242;
    --text-dark: #212121;
    --text-light: #757575;
    --success: #2e7d32;
    --error: #c62828;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-gray);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.top-navigation {
    background: var(--primary-blue);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desktop-menu {
    display: flex;
    gap: 2rem;
}

.desktop-menu a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.desktop-menu a:hover,
.desktop-menu a:focus {
    color: var(--accent-orange);
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

.phone-number {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.phone-number:hover,
.phone-number:focus {
    color: var(--accent-orange);
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

/* Mobile menu */
.mobile-menu {
    display: none;
}

.burger-menu {
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 4px;
}

.burger-menu:focus {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--white);
    transition: 0.3s;
}

.mobile-dropdown {
    display: none;
    background: var(--medium-blue);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
}

.mobile-dropdown a {
    color: var(--white);
    text-decoration: none;
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--light-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-dropdown a:last-child {
    border-bottom: none;
}

.mobile-dropdown a:hover,
.mobile-dropdown a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-orange);
    outline: none;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-orange);
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Visually hidden class for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header section */
.header {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
    margin: 3rem 0;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.description p {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.master-photo {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.accent-button {
    background: linear-gradient(135deg, var(--accent-orange), var(--dark-orange));
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.accent-button:hover,
.accent-button:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    background: var(--accent-orange);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-content h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-content p {
    color: var(--text-dark);
    line-height: 1.6;
}

/* Services */
.section-title {
    font-size: 2rem;
    color: var(--primary-blue);
    text-align: center;
    margin: 3rem 0 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-orange);
}

.service-category {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.service-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.service-header:hover,
.service-header:focus {
    background: var(--medium-blue);
    outline: 2px solid var(--white);
    outline-offset: -2px;
}

.service-content {
    padding: 2rem;
    display: none;
}

.service-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.price-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.price-list th {
    background: var(--light-gray);
    color: var(--primary-blue);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--medium-gray);
}

.price-list td {
    padding: 1rem;
    border-bottom: 1px solid var(--medium-gray);
    color: var(--text-dark);
}

.price-list tr:hover {
    background: var(--light-gray);
}

.disclaimer {
    font-style: italic;
    color: var(--text-dark);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.6;
}

/* FAQ */
.faq-item {
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-question {
    background: var(--white);
    color: var(--primary-blue);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.faq-question:hover,
.faq-question:focus {
    background: var(--light-gray);
    outline: 2px solid var(--accent-orange);
    outline-offset: -2px;
}

.faq-answer {
    padding: 0 1.5rem;
    display: none;
}

.faq-answer.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.faq-answer p {
    padding: 1.5rem 0;
    color: var(--text-dark);
    line-height: 1.6;
    border-top: 1px solid var(--medium-gray);
}

/* Two column layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rating-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.rating-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.rating-table {
    width: 100%;
    border-collapse: collapse;
}

.rating-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--medium-gray);
    color: var(--text-dark);
}

.rating-table tr:last-child td {
    border-bottom: none;
}

.stars {
    color: var(--star-gold);
    font-weight: 600;
}

/* Reviews */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-name {
    font-weight: 600;
    color: var(--primary-blue);
}

.review-date {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.review-stars {
    color: var(--star-gold);
    margin-bottom: 0.5rem;
}

.review-text {
    color: var(--text-dark);
    line-height: 1.5;
}

/* Sidebar features */
.sidebar-features {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sidebar-features h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.sidebar-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--medium-gray);
    color: var(--text-dark);
}

.sidebar-feature:last-child {
    border-bottom: none;
}

.sidebar-feature i {
    color: var(--accent-orange);
    width: 20px;
    text-align: center;
}

/* Guarantee badge */
.guarantee-badge {
    background: linear-gradient(135deg, var(--accent-orange), var(--dark-orange));
    color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.guarantee-badge h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.guarantee-badge p {
    color: var(--white);
    line-height: 1.5;
}

/* Footer */
footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section h3 {
    color: var(--accent-orange);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.footer-section p,
.footer-section a {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.footer-section a:hover,
.footer-section a:focus {
    color: var(--accent-orange);
    outline: none;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-links a:hover,
.social-links a:focus {
    background: var(--accent-orange);
    transform: translateY(-2px);
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--light-blue);
    color: var(--medium-gray);
    margin-top: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-light);
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--error);
    background: var(--light-gray);
    outline: 2px solid var(--accent-orange);
}

/* Quiz styles */
.quiz-step {
    display: none;
}

.quiz-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.discount-badge {
    background: linear-gradient(135deg, var(--accent-orange), var(--dark-orange));
    color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.quiz-progress {
    margin-bottom: 2rem;
}

.progress-text {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    background: var(--medium-gray);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, var(--accent-orange), var(--dark-orange));
    height: 100%;
    transition: width 0.3s ease;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.quiz-option {
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
}

.quiz-option:hover,
.quiz-option:focus {
    border-color: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline: none;
}

.quiz-option.active {
    border-color: var(--accent-orange);
    background: rgba(230, 81, 0, 0.1);
}

.quiz-option[aria-checked="true"] {
    border-color: var(--accent-orange);
    background: rgba(230, 81, 0, 0.1);
}

.quiz-hint {
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.quiz-button {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quiz-button:hover,
.quiz-button:focus {
    background: var(--medium-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Focus styles for all interactive elements */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .desktop-menu {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .mobile-dropdown.active {
        display: block;
    }
    
    .header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .quiz-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-button {
        justify-content: center;
    }
}