.calc {
    padding: 32px;
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.calc::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--main-template-color) 0%, #764ba2 100%);
}
.calc:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.calc h3 {
    width: auto;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: left;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--main-template-color) 0%, #764ba2 100%);
    color: #ffffff;
    text-transform: none;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}
.calc h3::after {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    width: 40px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: skewX(-20deg);
}
.calc ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
.calc hr {
    height: 1px;
    background: #ececec;
    margin: 5px 0;
    position: relative;
    opacity: 1;
}
.calc p {
    font-weight: 600;
    width: auto;
    margin: 0 0 12px 0;
    color: #334155;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}
.calc ul li {
    margin: 0 16px 16px 0;
    display: inline-block;
    vertical-align: top;
}
.calc ul li:first-child {
    margin-left: 0;
    margin-right: 24px;
    width: 100%;
    margin-bottom: 16px;
}
.calc input[type="number"] {
    padding: 12px 16px;
    width: 120px;
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #334155;
}
.calc input[type="number"]:focus {
    outline: none;
    border-color: var(--main-template-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.calc input[type="number"]:hover {
    border-color: #cbd5e1;
}
.calc select {
    padding: 12px 16px;
    width: 100%;
    max-width: 400px;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #334155;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}
.calc select:focus {
    outline: none;
    border-color: var(--main-template-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.calc select:hover {
    border-color: #cbd5e1;
}
.calc .razdelitel {
    margin-left: 12px;
    margin-right: 8px;
    font-weight: 600;
    color: var(--main-template-color);
    font-size: 1.1rem;
}
.calc ul li.otstup_abh {
    margin-left: 8px;
}
.calc .calc_rezultat {
    margin: 48px 0 0 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    position: relative;
}
.calc .calc_rezultat::before {
    content: '';
    position: absolute;
    top: -21px;
    left: 24px;
    width: 45px;
    height: 45px;
    background: #ffffff url('../images/calc_money.png') no-repeat center center;
    background-size: 24px 24px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
}
.calc .calc_rezultat p {
    width: 100%;
    padding: 12px 0;
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    text-transform: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    font-weight: 500;
}
.calc .calc_rezultat p:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: #334155;
    margin: 16px -24px -24px;
    padding: 20px 24px;
    border-radius: 0 0 16px 16px;
}
.calc_rez,
.calc .rub {
    font-size: 1.2rem;
    color: #059669;
    font-weight: 700;
}
.calc .rub {
    margin-left: 4px;
    text-transform: lowercase;
    font-size: 0.9rem;
    opacity: 0.8;
}
.calc input[type=radio] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.calc input[type=radio] ~ label {
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
    display: inline-block;
    margin-bottom: 8px;
}
.calc input[type=radio] ~ label:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
    transition: all 0.2s ease;
}
.calc input[type=radio] ~ label:after {
    content: '';
    position: absolute;
    top: 6px;
    left: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--main-template-color);
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}
.calc input[type=radio]:checked ~ label:before {
    border-color: var(--main-template-color);
    background: #ffffff;
}
.calc input[type=radio]:checked ~ label:after {
    opacity: 1;
    transform: scale(1);
}
.calc input[type=radio]:checked ~ label {
    color: #334155;
}
.calc input[type=radio] ~ label:hover:before {
    border-color: #94a3b8;
}
.calc input[type=checkbox] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.calc input[type=checkbox] ~ label {
    cursor: pointer;
    position: relative;
    padding-left: 68px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
}
.calc input[type=checkbox] ~ label:before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: #cbd5e1;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.calc input[type=checkbox] ~ label:after {
    content: '';
    position: absolute;
    top: 0px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.calc input[type=checkbox]:checked ~ label:before {
    background: linear-gradient(135deg, var(--main-template-color), #764ba2);
}
.calc input[type=checkbox]:checked ~ label:after {
    transform: translateX(24px);
}
.calc input[type=checkbox]:checked ~ label {
    color: #334155;
}
/* Дополнительные улучшения */
.calc input:focus,
.calc select:focus {
    transform: translateY(-1px);
}

.calc input[type=radio] ~ label:hover,
.calc input[type=checkbox] ~ label:hover {
    color: #334155;
}
.calc_rezultat {
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.calc ul {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}
.calc ul:last-of-type {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .calc {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .calc h3 {
        font-size: 1.1rem;
        padding: 10px 16px;
        margin-bottom: 20px;
    }
    .calc ul li {
        float: none;
        display: block;
        margin: 0 0 12px 0;
        width: 100%;
    }
    .calc ul li:first-child {
        margin-bottom: 12px;
    }
    .calc input[type="number"] {
        width: 100%;
        max-width: 120px;
    }
    .calc select {
        width: 100%;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    .calc .calc_rezultat {
        margin: 32px 0 0 0;
        padding: 16px;
    }
    .calc .calc_rezultat::before {
        left: 16px;
    }
    .calc .calc_rezultat p {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .calc .calc_rezultat p:last-child {
        margin: 12px -16px -16px;
        padding: 16px;
    }
    .calc .razdelitel {
        margin-left: 8px;
        margin-right: 4px;
    }
    .calc ul li.otstup_abh {
        margin-left: 0;
    }
    .calc input[type=radio] ~ label,
    .calc input[type=checkbox] ~ label {
        display: block;
        margin-bottom: 12px;
    }
}