/* =========================================
   ФИНАЛЬНЫЙ CSS ДЛЯ MOSINTORG
   Покрывает: Шапку, Футер, Статьи, Главную, Списки
   ========================================= */

/* --- 1. БАЗА И ПЕРЕМЕННЫЕ --- */
:root {
    --bg-primary: #08090A;      
    --bg-secondary: #121316;    
    --bg-tertiary: #1A1B1F;     
    --border: #2A2B2E;          
    --text-primary: #FFFFFF;    
    --text-secondary: #9CA3AF;  
    --text-tertiary: #6B7280;   
    --accent: #5E6AD2;          
    --accent-hover: #4E5AC0;    
    --accent-glow: rgba(94, 106, 210, 0.3); 
    --success: #10B981;         
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 1em;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5em;
}


/* --- 2. ШАПКА (NEW TWO-ROW HEADER) --- */
.mosintorg-header {
    background-color: var(--bg-secondary); 
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 9999;
    font-family: inherit;
    width: 100%;
}

.mh-top-bar {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mh-flex-center {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.mh-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}
.mh-logo img {
    border-radius: 6px;
}

.mh-search-form {
    flex-grow: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s;
}
.mh-search-form:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}
.mh-search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}
.mh-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.mh-search-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mh-search-btn:hover {
    color: var(--text-primary);
}

.mh-email-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}
.mh-email-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
}
.mh-email-text {
    display: inline-block;
}

.mh-bottom-bar {
    padding: 8px 0;
}

.mh-nav-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mh-main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    flex-grow: 1;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
.mh-main-nav::-webkit-scrollbar {
    display: none; 
}

.mh-main-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.2s;
    flex-shrink: 0;
}
.mh-main-nav a:hover,
.mh-main-nav a.current-menu-item {
    color: var(--text-primary);
}

.mh-arrow {
    font-size: 24px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    user-select: none;
    padding: 0 5px;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}
.mh-arrow:hover {
    color: var(--text-primary);
}


/* --- 3. ГЛАВНАЯ СТРАНИЦА (HERO & TOOLS GRID) --- */
/* Это критически важно для того, чтобы главная не была кривой */

.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(94, 106, 210, 0.15), transparent 60%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #FFFFFF 0%, #9CA3AF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.tools-section {
    padding: 80px 0 120px;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.icon-box {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
}

.badge {
    padding: 4px 10px;
    background: rgba(94, 106, 210, 0.1);
    border: 1px solid rgba(94, 106, 210, 0.2);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.card-body {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Формы внутри карточек инструментов */
.field {
    margin-bottom: 12px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.field input,
.field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
    width: 100%;
    padding: 11px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 8px;
    text-decoration: none;
    display: block; /* Для кнопок в формах */
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 0 2px var(--accent-glow);
    text-decoration: none;
}

.result-box {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: none;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.result-box.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.result-box p {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.result-box b {
    color: var(--text-primary);
    font-weight: 600;
}


/* --- 4. ОТДЕЛЬНЫЕ СТАТЬИ И СТРАНИЦЫ --- */
.site-main, 
.content-area, 
#primary, 
#content {
    flex-grow: 1;
    padding: 40px 0;
}

article.post, 
.page-content, 
.entry-content {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

h1.entry-title, 
h1.page-title {
    font-size: 32px;
    margin-bottom: 24px;
}

/* CTA блоки в статьях */
.mt-tool-cta {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 30px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mt-tool-cta:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mt-tool-cta h3 {
    margin-top: 0;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.mt-tool-cta p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}


/* --- 5. ФУТЕР --- */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
    margin-top: auto; 
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-brand {
    flex: 1;
    min-width: 250px;
}

.footer-nav, .footer-info {
    flex: 1;
    min-width: 200px;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer p {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}


/* --- 6. АДАПТИВНОСТЬ (MOBILE) --- */
@media (max-width: 768px) {
    
    /* Контент */
    h1.entry-title {
        font-size: 26px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .footer-inner {
        flex-direction: column;
        gap: 30px;
    }

    /* Шапка на мобилке */
    .mh-flex-center {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mh-logo { order: 1; }
    .mh-email-link { 
        order: 2; 
        margin-left: auto; 
        padding: 4px 8px; 
    }
    .mh-email-text { 
        font-size: 11px; 
    }
    
    .mh-search-form { 
        order: 3; 
        width: 100%; 
        max-width: 100%;
        margin-top: 5px;
    }

    .mh-main-nav {
        gap: 15px;
    }
    .mh-main-nav a {
        font-size: 13px;
    }
    
    .mh-arrow {
        font-size: 20px;
    }

    /* Главная на мобилке */
    .hero-title {
        font-size: 40px;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .field-row {
        grid-template-columns: 1fr;
    }
}
/* =========================================
   КНОПКА НАВЕРХ (BACK TO TOP)
   ========================================= */
.mt-back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mt-back-to-top-btn:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.mt-back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}