/* Новая цветовая палитра: голубой, серый, белый, пастельные оттенки */
:root {
    --main-bg: #fafdff;
    --header-bg: #f3fbfa;
    --section-bg: #ffffff;
    --accent-main: #b1ddda;
    --accent-main-dark: #5fa7a4;
    --accent-main-light: #eaf7f6;
    --accent-blue: #6bb6ec;
    --accent-blue-light: #bfe3fa;
    --white: #ffffff;
    --shadow: rgba(177, 221, 218, 0.07);
}

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

body {
    font-family: 'Montserrat', Arial, sans-serif;
    background: var(--main-bg);
    color: #2d3a3a;
    min-height: 100vh;
    line-height: 1.6;
}

.header h1, h2, .summary-card h3, .table-container h3 {
    font-family: 'Tenor Sans', Arial, sans-serif;
    color: #3a4a4a;
    font-weight: 400;
}

label, .btn-primary, .btn-secondary, input, th, td {
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 400;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--header-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    border: 2px solid var(--accent-main);
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-main-dark);
    text-shadow: 2px 2px 4px var(--shadow);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #5fa7a4;
    font-style: italic;
    font-weight: 400;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section,
.early-payment-section,
.results-section {
    background: var(--section-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--accent-main-light);
    position: relative;
}

.input-section::before,
.early-payment-section::before,
.results-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-main-light), var(--white), var(--accent-main-light));
    border-radius: 17px;
    z-index: -1;
}

.results-section {
    grid-column: 1 / -1;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #3a4a4a;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 1px 1px 2px var(--shadow);
    position: relative;
    font-weight: 400;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-main), var(--accent-blue));
    border-radius: 1px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #5fa7a4;
    font-size: 1rem;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--accent-main);
    border-radius: 8px;
    background: var(--white);
    color: #2d3a3a;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 400;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-main-dark);
    box-shadow: 0 0 10px var(--accent-main-light);
    background: var(--white);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-family: 'Montserrat', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    font-weight: 400;
}

.btn-primary {
    background: linear-gradient(145deg, var(--accent-main), var(--accent-blue));
    color: var(--white);
    box-shadow: 0 4px 15px var(--accent-main-light);
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--accent-blue), var(--accent-main));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-main);
}

.btn-secondary {
    background: linear-gradient(145deg, var(--white), var(--accent-main-light));
    color: var(--accent-main-dark);
    border: 2px solid var(--accent-main);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, var(--accent-main-light), var(--white));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-main);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

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

.summary-card {
    background: linear-gradient(145deg, var(--white), var(--accent-main-light));
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--accent-main-light);
    box-shadow: 0 5px 15px var(--shadow);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #3a4a4a;
    margin-bottom: 10px;
    font-weight: 400;
}

.summary-card p {
    font-size: 1.5rem;
    color: var(--accent-blue);
    text-shadow: 1px 1px 2px var(--shadow);
    font-weight: 400;
}

.chart-container {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--accent-main-light);
}

.table-container {
    margin-top: 30px;
}

.table-container h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #3a4a4a;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 400;
}

.table-wrapper {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--accent-main-light);
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: linear-gradient(145deg, var(--accent-main-light), var(--white));
    color: #5fa7a4;
    padding: 15px 10px;
    text-align: center;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 400;
}

td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid var(--accent-main-light);
    color: #2d3a3a;
    font-size: 0.9rem;
    font-weight: 400;
}

tr:nth-child(even) {
    background: var(--accent-main-light);
}

tr:hover {
    background: var(--accent-blue-light);
}

.export-section {
    text-align: center;
    margin: 30px 0;
}

@media (max-width: 600px) {
    .container {
        padding: 8px;
    }
    .main-content {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    .header {
        padding: 16px 4px;
        border-radius: 10px;
    }
    .header h1 {
        font-size: 1.3rem;
    }
    h2 {
        font-size: 1.1rem;
    }
    .input-section, .early-payment-section, .results-section {
        padding: 12px 4px;
        border-radius: 8px;
    }
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .summary-card {
        padding: 10px 4px;
        border-radius: 8px;
    }
    .summary-card h3 {
        font-size: 1rem;
    }
    .summary-card p {
        font-size: 1.1rem;
    }
    .chart-container {
        padding: 6px;
        border-radius: 8px;
    }
    .table-container h3 {
        font-size: 1rem;
    }
    th, td {
        padding: 6px 2px;
        font-size: 0.8rem;
    }
    .btn-primary, .btn-secondary {
        padding: 10px 4px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .container {
        padding: 12px;
    }
    .main-content {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 28px;
    }
    .header {
        padding: 22px 8px;
        border-radius: 14px;
    }
    .header h1 {
        font-size: 1.7rem;
    }
    h2 {
        font-size: 1.3rem;
    }
    .input-section, .early-payment-section, .results-section {
        padding: 18px 8px;
        border-radius: 12px;
    }
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .summary-card {
        padding: 14px 8px;
        border-radius: 10px;
    }
    .summary-card h3 {
        font-size: 1.1rem;
    }
    .summary-card p {
        font-size: 1.2rem;
    }
    .chart-container {
        padding: 10px;
        border-radius: 10px;
    }
    .table-container h3 {
        font-size: 1.1rem;
    }
    th, td {
        padding: 8px 4px;
        font-size: 0.9rem;
    }
    .btn-primary, .btn-secondary {
        padding: 12px 8px;
        font-size: 1rem;
        border-radius: 10px;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .container {
        padding: 18px;
    }
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-bottom: 36px;
    }
    .header {
        padding: 26px 12px;
        border-radius: 16px;
    }
    .header h1 {
        font-size: 2.1rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    .input-section, .early-payment-section, .results-section {
        padding: 24px 12px;
        border-radius: 14px;
    }
    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .summary-card {
        padding: 18px 12px;
        border-radius: 12px;
    }
    .summary-card h3 {
        font-size: 1.15rem;
    }
    .summary-card p {
        font-size: 1.3rem;
    }
    .chart-container {
        padding: 14px;
        border-radius: 12px;
    }
    .table-container h3 {
        font-size: 1.2rem;
    }
    th, td {
        padding: 10px 6px;
        font-size: 1rem;
    }
    .btn-primary, .btn-secondary {
        padding: 14px 12px;
        font-size: 1.05rem;
        border-radius: 12px;
    }
}

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

.results-section {
    animation: fadeIn 0.5s ease-out;
}

.hidden {
    display: none !important;
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--accent-main-light);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, var(--accent-main), var(--accent-blue));
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, var(--accent-blue), var(--accent-main));
} 