/* General Modal Styles */

/* .read-more-button {
    border-color: #fff;
    color: #fff;
    outline-color: #fff;
} */

.choice-modal-content .modal-body {
    text-align: center;
    font-size: 1.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.choice-modal-content .modal-body .more2 {
    margin: 0;
}

/* Альтернативные стили для кнопки с id="brief-button" */
.more2 {
    margin-bottom: 1rem;
    margin-right: 1rem;
    transition: all .2s ease-out;
    overflow: hidden;
    position: relative;
    border: 1px solid #15011d;
    /* background: #fff; */
    border-radius: calc(50/16*1rem);
    color: #15011d;
    font-size: calc(16/16*1rem);
    font-weight: 400;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: start;
    justify-content: flex-start;
    padding: 11px 24px;
    margin-left: auto;
    min-height: 3rem;
}

.more2::before {
    content: "";
    display: block;
    background: #00e6e3;
    border-radius: 48px;
    height: calc(100% + 2px);
    width: calc(100% + 2px);
    position: absolute;
    left: -1px;
    top: -1px;
    transform: translate(-100%, 0) rotate(10deg);
    transform-origin: top left;
    transition: transform .2s ease-out;
    z-index: -1;
}

.more2:hover,
.more2:focus,
.more2:focus-within,
.more2.default-active {
    color: #15011d;
    border-color: #00e6e3;
    background: #00e6e3;
    box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .2);
    transform: scale(1.1);
    z-index: 1;
}

.more2:hover::before,
.more2:focus::before,
.more2:focus-within::before,
.more2.default-active::before {
    transform: translate(0);
}

.more2>img {
    display: inline-block;
    width: 23px;
    height: 14px;
    margin-left: 16px;
    transition: all .2s ease-out;
    flex-shrink: 0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(21, 22, 37, 0.8);
    font-family: "Ubuntu-Regular", sans-serif;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 680px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: animatetop 0.4s;
}

@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

.modal-header {
    padding: 10px 16px;
    color: #151625;
    border-bottom: 1px solid #e0eff7;
    position: relative;
    text-align: center;
}

.modal-header h3 {
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: clamp(1.5rem, 1vw, 2rem);
}

.modal-close {
    color: #aaaaaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #0070ad;
    text-decoration: none;
}

.modal-body {
    padding: 20px 16px;
}

/* Choice Modal Specific Styles */
.choice-modal-content .modal-body {
    text-align: center;
    font-size: 1.125rem;
}

.choice-modal-content .modal-body p {
    margin: 20px 0;
}

.choice-button,
.brief-button {
    all: unset;
    display: block;
    box-sizing: border-box;
    cursor: pointer;
    background-color: #fff;
    color: #0070ad;
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: 1.2rem;
    line-height: 1;
    width: 100%;
    padding: 15px 30px;
    border-radius: 999rem;
    border: 2px solid #0070ad;
    transition: all .3s ease-in-out;
    margin: 10px 0;
    text-align: center;
}

.choice-button:hover,
.brief-button:hover,
.choice-button.default-active {
    background-color: #0070ad;
    color: #fff;
}

.choice-button.default-active:hover {
    background-color: #0056b3;
    color: #fff;
}

/* Quiz Modal Specific Styles */
.quiz-modal-content {
    margin: 5% auto;
}

.quiz-modal .progress-container {
    width: calc(100% - 60px);
    /* Adjust width to not overlap with close button */
    margin: 10px auto;
    flex-direction: column;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background-color: #0070ad;
    border-radius: 10px;
    transition: width 0.3s ease-in-out;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #51595e;
}

.service-breadcrumb {
    font-size: 0.9rem;
    color: #51595e;
    margin-bottom: 20px;
    text-align: center;
    padding: 5px 10px;
    background: #f4f4f4;
    border-radius: 4px;
}

.modal-footer {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e0eff7;
    margin-top: 20px;
}

.nav-button {
    all: unset;
    display: inline-block;
    box-sizing: border-box;
    cursor: pointer;
    background-color: #0070ad;
    color: #fff;
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: 1rem;
    padding: 12px 28px;
    border-radius: 999rem;
    border: 2px solid #0070ad;
    transition: all .3s ease-in-out;
}

.nav-button:disabled {
    background-color: #ecedf2;
    border-color: #ecedf2;
    color: #818e94;
    cursor: not-allowed;
}

.back-button {
    background-color: #fff;
    color: #0070ad;
}

.nav-button:not(:disabled):hover {
    background-color: #fff;
    color: #0070ad;
}

.back-button:hover {
    background-color: #e0eff7;
}

.question {
    margin-top: 20px;
}

.question-title {
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: clamp(1.25rem, 1vw, 1.75rem);
    color: #151625;
    margin-bottom: 10px;
}

.question-description {
    font-size: 1rem;
    color: #51595e;
    margin-bottom: 20px;
}

.text-input,
textarea.text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    font-family: "Ubuntu-Regular", sans-serif;
    font-size: 1rem;
}

.text-input:focus,
textarea.text-input:focus {
    outline: 2px solid #0070ad;
    border-color: #0070ad;
}

.choice-options,
.service-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-option,
.service-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
    background-color: #f9f9f9;
}

.choice-option:hover,
.service-option:hover {
    background-color: #e0eff7;
}

/* Highlight selected option */
.choice-option:has(input[type="radio"]:checked),
.service-option:has(input[type="radio"]:checked) {
    background-color: #e0eff7;
    border-color: #0070ad;
}

.choice-option .choice-text,
.service-option .service-text {
    cursor: pointer;
    flex-grow: 1;
}

.choice-option input[type="radio"],
.service-option input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    width: 1.25em;
    height: 1.25em;
    border: 2px solid #818e94;
    border-radius: 50%;
    display: grid;
    place-content: center;
    transition: 120ms all ease-in-out;
}

.choice-option input[type="radio"]::before,
.service-option input[type="radio"]::before {
    content: "";
    width: 0.75em;
    height: 0.75em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #0070ad;
}

.choice-option input[type="radio"]:checked,
.service-option input[type="radio"]:checked {
    border-color: #0070ad;
}

.choice-option input[type="radio"]:checked::before,
.service-option input[type="radio"]:checked::before {
    transform: scale(1);
}

.validation-error {
    color: #d93025;
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Consent Screen Styles */
.consent-text {
    font-size: 1rem;
    color: #51595e;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
}

.consent-text a {
    color: #0070ad;
    text-decoration: none;
    border-bottom: 1px solid #0070ad;
    transition: color 0.3s, border-bottom-color 0.3s;
    display: inline;
}

.consent-text a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

#consent-button {
    display: block;
    margin: 20px auto 0;
}

/* Thank You Screen Styles */
.modal-body:has(.thank-you-message) {
    text-align: center;
    padding: 40px 20px;
}

.thank-you-message h4 {
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: 2rem;
    color: #151625;
    margin-top: 20px;
    margin-bottom: 10px;
}

.thank-you-message p {
    font-size: 1.1rem;
    color: #51595e;
    margin-bottom: 30px;
}

.thank-you-message::before {
    content: '✔';
    display: block;
    font-size: 50px;
    color: #fff;
    background-color: #0070ad;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    line-height: 80px;
    margin: 0 auto 20px;
    animation: thank-you-icon-animation 0.5s ease-in-out;
}

@keyframes thank-you-icon-animation {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.modal-footer:has(.restart-quiz-button) {
    justify-content: center;
    border-top: none;
}

.restart-quiz-button {
    all: unset;
    display: inline-block;
    box-sizing: border-box;
    cursor: pointer;
    background-color: #0070ad;
    color: #fff;
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: 1rem;
    padding: 12px 28px;
    border-radius: 999rem;
    border: 2px solid #0070ad;
    transition: all .3s ease-in-out;
}

.restart-quiz-button:hover {
    background-color: #fff;
    color: #0070ad;
}


/* Service Tree FAQ-style Styles */
.service-tree {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
}

.service-tree-list {
    padding: 0;
    margin: 0;
}

.service-category {
    border-bottom: 1px solid #f0f0f0;
}

.service-category:last-child {
    border-bottom: none;
}

.service-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.service-category-header:hover {
    background-color: #e9ecef;
}

.service-category-header.expanded {
    background-color: #e0eff7;
}

.service-category-title {
    font-family: "Ubuntu-Medium", sans-serif;
    font-size: 1.1rem;
    color: #151625;
    font-weight: 600;
}

.service-category-arrow {
    font-size: 1rem;
    color: #51595e;
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.service-category-content {
    display: none;
    background-color: #fff;
}

.service-subcategory {
    border-bottom: 1px solid #f5f5f5;
}

.service-subcategory:last-child {
    border-bottom: none;
}

.service-subcategory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    cursor: pointer;
    background-color: #fbfbfb;
    transition: background-color 0.2s ease;
}

.service-subcategory-header:hover {
    background-color: #f0f0f0;
}

.service-subcategory-header.expanded {
    background-color: #f0f8ff;
}

.service-subcategory-title {
    font-family: "Ubuntu-Regular", sans-serif;
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.service-subcategory-arrow {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
    width: 18px;
    text-align: center;
}

.service-subcategory-content {
    display: none;
    background-color: #fff;
}

.service-item {
    padding: 12px 80px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f8f8;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item.selectable {
    cursor: pointer;
}

.service-item.selectable:hover {
    background-color: #f0f8ff;
}

.service-item.selected {
    background-color: #e0eff7;
    border-left: 4px solid #0070ad;
}

.service-name {
    font-family: "Ubuntu-Regular", sans-serif;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.4;
}

.service-item.selected .service-name {
    color: #0070ad;
    font-weight: 500;
}

/* Direct category services (no subcategories) */
.service-category .service-item.selectable {
    padding: 15px 20px;
    background-color: #f8f9fa;
}

.service-category .service-item.selectable:hover {
    background-color: #e9ecef;
}

.service-category .service-item.selected {
    background-color: #e0eff7;
    border-left: 4px solid #0070ad;
}

.service-category .service-item.selected .service-name {
    color: #0070ad;
    font-weight: 600;
}

/* Scrollbar styling for service tree */
.service-tree::-webkit-scrollbar {
    width: 6px;
}

.service-tree::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.service-tree::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.service-tree::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@media screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 15px;
    }

    .choice-modal-content .modal-body {
        font-size: 1rem;
    }
    
    .service-tree {
        max-height: 300px;
    }
    
    .service-category-header {
        padding: 12px 15px;
    }
    
    .service-subcategory-header {
        padding: 10px 30px;
    }
    
    .service-item {
        padding: 10px 60px;
    }
    
    .service-category .service-item.selectable {
        padding: 12px 15px;
    }
}