/* =========================================
   1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   ========================================= */
:root {
    --gold: #FFD700;
    --gold-bright: #FFE033;
    --bg-dark: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border-glass: rgba(255, 255, 255, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;

    background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('images/roberto-sorin-ZZ3qxWFZNRg-unsplash.jpg'); 
    background-color: var(--bg-dark); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section,
#services,
#projects,
#standards,
#contact {
    scroll-margin-top: 160px;
}

/* =========================================
   2. ШАПКА, ЛОГОТИП И НАВИГАЦИЯ
   ========================================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    min-height: 130px;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.85); 
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px); 
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-glass);
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 180px; 
    width: auto;
    max-width: 100%;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.7));
}

.logo-img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
}

.nav-menu {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--gold);
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.lang-switch span {
    cursor: pointer;
    transition: color 0.3s ease;
}

.lang-switch span.active,
.lang-switch span:hover {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.03));
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 10px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 800;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.whatsapp-btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* =========================================
   3. ГЛАВНЫЙ ЭКРАН (HERO)
   ========================================= */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.hero-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.highlight {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-muted);
}

.cta-button {
    display: inline-block;
    background-color: var(--gold);
    color: var(--bg-dark);
    padding: 16px 38px;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.cta-button:hover {
    background-color: var(--gold-bright);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.4);
}

/* =========================================
   4. СЕКЦИИ И КАРТОЧКИ
   ========================================= */
.section {
    padding: 80px 20px;
    width: 100%;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: var(--text-main);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.grid-container-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.card,
.project-card,
.standards-box,
.form-container {
    background-color: rgba(25, 25, 25, 0.45); 
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px); 
    border: 1px solid rgba(255, 255, 255, 0.12); 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 40px; 
    width: 100%;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.card:hover,
.project-card:hover,
.standards-box:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.2);
}

.card h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
}

.card h3 span {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.card ul {
    list-style-type: none;
}

.card li {
    margin-bottom: 15px;
    padding-left: 20px;
    position: relative;
    color: var(--text-main); 
}

.card li::before {
    content: "■";
    color: var(--gold);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.8rem;
}

.card strong {
    color: var(--text-main);
}

.project-card {
    padding: 25px; 
}

.img-placeholder {
    width: 100%;
    height: 220px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.project-card h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 15px;
}

.project-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 15px;
}

.standards-box {
    max-width: 900px;
    margin: 0 auto;
}

.standards-box ul {
    list-style-type: none;
    padding-left: 0;
}

.standards-box li {
    margin-bottom: 25px;
}

.standards-box strong {
    display: block;
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.standards-box span {
    color: var(--text-main);
}

/* =========================================
   5. ФОРМА ОБРАТНОЙ СВЯЗИ
   ========================================= */
.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.form-group option {
    background-color: var(--bg-dark); 
    color: var(--text-main);
}

.submit-button {
    width: 100%;
    background-color: var(--gold);
    color: var(--bg-dark);
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: var(--gold-bright);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

/* =========================================
   6. КАСТОМНОЕ УВЕДОМЛЕНИЕ (ALERT NOTIFICATION)
   ========================================= */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.custom-alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-alert-box {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), 0 10px 40px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.show .custom-alert-box {
    transform: scale(1);
}

.custom-alert-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.custom-alert-box h3 {
    color: var(--gold);
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.custom-alert-box p {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

.custom-alert-btn {
    background-color: var(--gold);
    color: var(--bg-dark);
    padding: 12px 35px;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-alert-btn:hover {
    background-color: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* =========================================
   7. ПЛАВАЮЩАЯ КНОПКА С НАДПИСЬЮ BACK TO TOP
   ========================================= */
#back-to-top {
    position: fixed;
    bottom: 35px;
    right: 35px;
    width: 55px;
    height: 55px;
    background-color: #FFD700;
    color: #000000;
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 900;
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.6);
}

#back-to-top::before {
    content: 'TOP';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFD700;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1), 0 0 8px rgba(255, 215, 0, 0.6);
}

#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #FFE033;
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}

/* =========================================
   8. ПОДДЕРЖКА ИВРИТА (RTL - СПРАВА НАЛЕВО)
   ========================================= */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .card li {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .card li::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] #back-to-top {
    right: auto;
    left: 35px;
}

/* =========================================
   9. МОБИЛЬНАЯ АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 900px) {
    .header {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 15px 20px;
        min-height: auto;
        position: relative;
    }

    .section,
    #services,
    #projects,
    #standards,
    #contact {
        scroll-margin-top: 20px;
    }

    .logo-img {
        height: 110px;
        margin: 0 auto;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 4px;
    }

    .nav-menu a {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .header-actions {
        justify-content: center;
        width: 100%;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .grid-container,
    .grid-container-3 {
        grid-template-columns: 1fr;
    }

    .card,
    .project-card,
    .standards-box,
    .form-container {
        padding: 25px;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    html[dir="rtl"] #back-to-top {
        right: auto;
        left: 20px;
    }
}