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

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    text-decoration: none;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
}

.site-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.hero-section h1 {
    font-size: 48px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 20px;
    color: var(--text-gray);
    max-width: 700px;
    margin: 0 auto 20px;
}

.disclaimer-box {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 4px solid var(--warning-color);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 40px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.disclaimer-box strong {
    color: var(--warning-color);
    font-size: 16px;
}

.bot-link-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #0088cc;
    color: white !important;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
}

.bot-link-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 136, 204, 0.5);
    background: #0077b3;
}

.bot-link-hero svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.bot-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.bot-link-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.bot-link-inline svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.calculator-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 240px;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.calculator-card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.calculator-card h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.calculator-card p {
    color: var(--text-gray);
    font-size: 16px;
    margin-bottom: 0;
    flex: 1;
}

.bot-link-below {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: #0088cc;
    color: white !important;
    text-decoration: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.4);
    border: 2px solid #0088cc;
    align-self: center;
}

.bot-link-below:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 136, 204, 0.6);
    background: #0077b3;
    border-color: #0077b3;
}

.bot-link-below svg {
    width: 20px;
    height: 20px;
    fill: white;
    transition: fill 0.3s;
}

.bot-link-below:hover svg {
    fill: white;
}

.calculator-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.calculator-container h2 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.calculator-subtitle {
    color: var(--text-gray);
    font-size: 18px;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 700px;
}

.form-group input[type="number"],
.form-group input[type="text"] {
    max-width: 300px;
}

.form-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

label:has(input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
    white-space: nowrap;
}

label:has(input[type="radio"]):hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.result-section {
    background: var(--bg-light);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.result-section h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.result-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-label {
    font-weight: 600;
    color: var(--text-dark);
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--bg-light);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.site-footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    text-decoration: none;
    color: var(--text-gray);
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    color: var(--text-gray);
}

/* Category sections */
.category-section {
    margin-bottom: 60px;
}

.category-section h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: left;
    font-weight: 700;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.calc-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.calc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.calc-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.calc-card h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.calc-card p {
    color: var(--text-gray);
    font-size: 15px;
    margin-bottom: 20px;
    flex: 1;
}

/* Calculator pages layout */
.calc-header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.calc-header h1 {
    font-size: 36px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.calc-header p {
    font-size: 18px;
    color: var(--text-gray);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: var(--bg-light);
    border-radius: 10px;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.back-link:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateX(-5px);
}

.calc-layout {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.calc-form-section {
    margin-bottom: 0;
}

.calc-results-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 15px;
    border: 2px solid var(--border-color);
    display: none;
}

.calc-results-section.show {
    display: block;
}

/* Desktop layout: форма слева, результаты справа */
@media (min-width: 768px) {
    .calc-layout {
        display: grid;
        grid-template-columns: 380px 1fr;
        gap: 30px;
        align-items: start;
    }
    
    .calc-form-section {
        display: flex;
        flex-direction: column;
    }
    
    .calc-results-section {
        margin-top: 0;
        min-height: 200px;
    }
    
    .calc-results-section.show {
        display: block;
        position: sticky;
        top: 100px;
    }
    
    .info-block {
        grid-column: 1 / -1;
    }
}

.calc-results-section h3 {
    color: var(--text-dark);
    font-size: 22px;
    margin-bottom: 20px;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.info-block {
    margin-top: 30px;
    padding: 25px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
}

.info-block h4 {
    color: var(--text-dark);
    font-size: 18px;
    margin-bottom: 15px;
    margin-top: 20px;
}

.info-block h4:first-child {
    margin-top: 0;
}

.info-block p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-block ul {
    list-style: none;
    padding-left: 0;
}

.info-block li {
    color: var(--text-dark);
    padding: 8px 0;
    line-height: 1.6;
}

.info-block strong {
    color: var(--primary-color);
}

/* Fix input/select width */
.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    max-width: 100%;
    width: 100%;
}

/* Telegram section */
.telegram-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    margin: 60px 0;
    box-shadow: var(--shadow);
}

.telegram-section h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 15px;
}

.telegram-section p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
    color: white;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #0088cc;
    color: white !important;
    text-decoration: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
    border: 2px solid #0088cc;
}

.btn-telegram:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 136, 204, 0.6);
    background: #0077b3;
    border-color: #0077b3;
}

.btn-telegram svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-content {
        position: relative;
    }
    
    .hero-section h1 {
        font-size: 32px;
    }
    
    .hero-section p {
        font-size: 16px;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-container {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 10px;
        font-size: 14px;
    }
    
    .calc-layout {
        grid-template-columns: 1fr;
    }
    
    .results-sticky {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-radius: 20px 20px 0 0;
        z-index: 100;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .category-section h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 15px 0;
    }
    
    .logo h1 {
        font-size: 22px;
    }
    
    .calculator-container h2 {
        font-size: 24px;
    }
}
