/* Hero section */
#uslugi-hero {
    background: linear-gradient(135deg, rgba(196, 23, 29, .65), rgba(52, 58, 64, .65)), url('../img/24.jpg') center/cover no-repeat;
}

/* Form card */
.form-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    border: 1px solid #f0f0f0;
}

/* Form messages */
#form-messages {
    margin-bottom: 1.5rem;
}

#form-messages .alert {
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    animation: fadeInDown .5s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
}

#form-messages .alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

#form-messages .alert-success {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
    color: #0a3622;
}

#form-messages .alert-danger {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #58151c;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
}

.form-section-title {
    color: var(--tt-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 3px solid var(--tt-red);
    display: inline-block;
}

.form-section-title i {
    color: var(--tt-red);
}

/* Form labels and inputs */
.form-label {
    font-weight: 500;
    color: var(--tt-dark);
    margin-bottom: .5rem;
}

.form-control,
.form-select {
    border: 1.5px solid #dee2e6;
    padding: .625rem .875rem;
    border-radius: .5rem;
    transition: all .3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tt-red);
    box-shadow: 0 0 0 .25rem rgba(196, 23, 29, .15);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.radio-group-inline {
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-card {
    position: relative;
    cursor: pointer;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    align-items: center;
    padding: .875rem 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: .5rem;
    background: #fff;
    transition: all .3s ease;
    font-weight: 500;
    color: var(--tt-dark);
    position: relative;
}

.radio-card-content::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: .75rem;
    background: #fff;
    transition: all .3s ease;
    flex-shrink: 0;
}

.radio-card:hover .radio-card-content {
    border-color: var(--tt-red);
    background: rgba(196, 23, 29, .02);
}

.radio-card input[type="radio"]:checked ~ .radio-card-content {
    border-color: var(--tt-red);
    background: rgba(196, 23, 29, .08);
    color: var(--tt-red);
}

.radio-card input[type="radio"]:checked ~ .radio-card-content::before {
    border-color: var(--tt-red);
    background: var(--tt-red);
    box-shadow: inset 0 0 0 3px #fff;
}

.radio-card input[type="radio"]:focus ~ .radio-card-content {
    border-color: var(--tt-red);
    box-shadow: 0 0 0 .25rem rgba(196, 23, 29, .15);
}

.radio-card-content i {
    opacity: .7;
    transition: opacity .3s ease;
}

.radio-card input[type="radio"]:checked ~ .radio-card-content i {
    opacity: 1;
}

.radio-group .invalid-feedback {
    display: none;
    margin-top: .5rem;
    width: 100%;
}

.radio-group.is-invalid .invalid-feedback {
    display: block;
}

.radio-group.is-valid .invalid-feedback {
    display: none;
}

.radio-group.is-invalid .radio-card-content {
    border-color: #dc3545;
}

.radio-group.is-invalid .radio-card input[type="radio"]:checked ~ .radio-card-content {
    border-color: var(--tt-red);
}

/* Cost section */
.cost-section {
    background: linear-gradient(135deg, rgba(196, 23, 29, .02), rgba(196, 23, 29, .05));
    padding: 2rem;
    border-radius: .75rem;
    border: 2px solid var(--tt-red);
}

.cost-breakdown {
    margin-top: 1.5rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 1rem;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-item-label {
    color: #6c757d;
    font-weight: 500;
}

.cost-item-value {
    color: var(--tt-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 3px solid var(--tt-red);
}

.cost-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tt-dark);
}

.cost-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tt-red);
}

/* Discount info */
.discount-info {
    margin-top: 1rem;
    margin-bottom: 1rem;
    background-color: #cfe2ff;
    border-color: #9ec5fe;
    padding: 1rem 1.25rem;
    border-radius: .5rem;
}

.discount-info i {
    font-size: 1.1rem;
}

/* Submit button */
.btn-danger {
    transition: all .3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 23, 29, .3);
}

/* Calculate distance button */
#calculateDistanceBtn,
#calculateTrainingDistanceBtn {
    white-space: nowrap;
    padding: .625rem 1rem;
    font-weight: 500;
    border-color: #dee2e6;
    transition: all .3s ease;
}

#calculateDistanceBtn:hover,
#calculateTrainingDistanceBtn:hover {
    background-color: var(--tt-red);
    border-color: var(--tt-red);
    color: #fff;
}

#calculateDistanceBtn:disabled,
#calculateTrainingDistanceBtn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

#distanceStatus,
#trainingDistanceStatus {
    font-weight: 500;
    display: inline-block;
    margin-left: .25rem;
}

.input-group .form-control {
    border-right: none;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .form-card {
        padding: 1.5rem;
    }

    .form-section-title {
        font-size: 1.25rem;
    }

    .cost-label {
        font-size: 1.1rem;
    }

    .cost-value {
        font-size: 1.5rem;
    }

    .cost-total {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .radio-group-inline {
        flex-direction: column;
    }

    .radio-card {
        min-width: 100%;
    }

    .radio-card-content {
        padding: .75rem 1rem;
    }

    #calculateDistanceBtn,
    #calculateTrainingDistanceBtn {
        padding: .625rem .75rem;
        font-size: .9rem;
    }

    .input-group {
        flex-wrap: nowrap;
    }
}

@media (max-width: 400px) {
    #calculateDistanceBtn .bi,
    #calculateTrainingDistanceBtn .bi {
        margin-right: 0 !important;
    }

    #calculateDistanceBtn,
    #calculateTrainingDistanceBtn {
        font-size: 0;
        padding: .625rem .5rem;
    }

    #calculateDistanceBtn .bi,
    #calculateTrainingDistanceBtn .bi {
        font-size: 1rem;
    }
}

/* Animation for showing fields */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.training-field,
.it-service-field {
    animation: fadeIn .3s ease;
}
