@font-face {
    font-family: 'MoskvichSans-Medium';
    src: url('MoskvichSans-Medium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-header: 'MoskvichSans-Medium', sans-serif;
}

body[data-theme="cpb"] {
    --theme-header: #BA4618;
    --theme-header-dark: #a13d15;
    --theme-header-focus-shadow: rgba(186, 70, 24, .25);
    --theme-primary-focus: #d6440c;
    --theme-focus-shadow: rgba(214, 68, 12, .25);
    --theme-choices-chip-bg: #BA4618;
    --theme-choices-chip-border: #BA4618;
    --theme-choices-close-border: #a13d15;
}

body[data-theme="czn"] {
    --theme-header: #2062a5;
    --theme-header-dark: #1c568f;
    --theme-header-focus-shadow: rgba(32, 98, 165, .25);
    --theme-primary-focus: #007BFF;
    --theme-focus-shadow: rgba(0, 123, 255, .25);
    --theme-choices-chip-bg: #2062a5;
    --theme-choices-chip-border: #2062a5;
    --theme-choices-close-border: #1c568f;
}

html,
body {
    height: 100%;
    min-height: 100%;
}

body {
    background-color: #f7f6f4;
    font-family: var(--font-main);
    color: #3A3C42;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.main-container {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    width: 100%;
}

.header-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.logo {
    max-width: 140px;
    height: auto;
}

h1.h3.header-title {
    font-family: var(--font-header);
    color: var(--theme-header);
    font-size: 1.8rem;
    margin: 0;
    font-weight: 500;
    text-align: center;
}

h2.h4 {
    color: var(--theme-header);
    font-family: var(--font-main);
    font-weight: 500;
}

.card {
    border-radius: 1.5rem;
    border: none;
    background-color: #fff;
    width: 100%;
}

.custom-input,
.custom-select {
    font-size: 1.15rem;
    padding: .95rem 1.35rem;
    border-radius: 1.25rem;
    background-color: #f8f8f8;
}

textarea.custom-input {
    resize: none;
}

.custom-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.custom-select.select-placeholder {
    color: #9ca3af;
}

.custom-input:focus,
.custom-select:focus {
    border-color: var(--theme-primary-focus);
    box-shadow: 0 0 0 .2rem var(--theme-focus-shadow);
    background-color: #fff;
}

.custom-select option {
    padding: 10px 15px;
    font-size: 1.15rem;
    color: #3A3C42;
}

.custom-select option:disabled {
    color: #9ca3af;
}

.option-cpb {
    color: #E44621 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
}

.option-mfc {
    color: #0d6efd !important;
    font-size: 1.15rem !important;
    font-weight: 500 !important;
}

body[data-theme="cpb"] .custom-select:has(option.option-cpb:checked) {
    color: #E44621;
    font-weight: 700;
}

body[data-theme="czn"] .custom-select:has(option.option-mfc:checked) {
    color: #0d6efd;
    font-weight: 500;
}

.form-check {
    display: flex;
    align-items: center;
    min-height: 1.4em;
}

.form-check-input {
    width: 1.4em;
    height: 1.4em;
    margin-top: 0;
    border-radius: .35rem;
    border: 2px solid #adb5bd;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    cursor: pointer;
    margin-left: 0.5em;
}

.form-check-input:checked {
    background-color: var(--theme-header);
    border-color: var(--theme-header);
}

.form-check-input:focus {
    box-shadow: 0 0 0 .2rem var(--theme-header-focus-shadow);
    border-color: var(--theme-header);
}

.link-custom {
    color: var(--theme-header);
    text-decoration: underline;
}

.link-custom:hover {
    color: var(--theme-header-dark);
}

.btn-custom {
    background-color: var(--theme-header);
    border-color: var(--theme-header);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    padding: .85rem 1.5rem;
    border-radius: 1rem;
    transition: background-color .2s ease-in-out, border-color .2s ease-in-out, opacity .2s ease-in-out;
}

.btn-custom:hover:not(:disabled),
.btn-custom:focus:not(:disabled) {
    background-color: var(--theme-header-dark);
    border-color: var(--theme-header-dark);
    color: #fff;
}

.btn-custom:focus:not(:disabled) {
    box-shadow: 0 0 0 .2rem var(--theme-header-focus-shadow);
}

.btn-custom.disabled-look {
    opacity: 0.65;
    cursor: default;
    background-color: #e0e0e0 !important;
    border-color: #e0e0e0 !important;
}

.modal-custom-content {
    border-radius: 1.5rem;
    color: #fff;
    border: none;
    padding: 1rem;
    transition: background-color .3s ease-in-out;
}

.modal-custom-content.modal-state-success {
    background-color: #198754;
}

.modal-custom-content.modal-state-info {
    background-color: #0d6efd;
}

.modal-custom-content.modal-state-danger {
    background-color: #dc3545;
}

.modal-header .btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    width: 100%;
    text-align: center;
}

.lead-modal {
    font-size: 1.3rem;
    font-weight: 400;
    color: #fff;
}

.modal-candidate-id {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    padding: .5rem 0;
}

.btn-custom-modal {
    background-color: #fff;
    border: 1px solid #3A3C42;
    color: #3A3C42;
    font-weight: 700;
    font-size: 1.2rem;
    padding: .75rem 1.5rem;
    border-radius: 1rem;
}

.btn-custom-modal:hover {
    background-color: #f1f1f1;
    border-color: #3A3C42;
    color: #3A3C42;
}

.btn-custom-modal:focus {
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .5);
}

.choices {
    font-size: 1.15rem;
}

.choices__inner {
    padding: .95rem 1.35rem;
    border-radius: 1.25rem;
    border: 1px solid #e5e7eb;
    min-height: auto;
    background-color: #f8f8f8;
}

.choices[data-type*="select-multiple"] .choices__inner {
    padding-bottom: calc(.95rem - 8px);
}

.choices.is-focused .choices__inner {
    background-color: #fff;
    border-color: var(--theme-primary-focus);
    box-shadow: 0 0 0 .2rem var(--theme-focus-shadow);
}

.choices__list--multiple .choices__item {
    font-size: 1rem;
    background-color: var(--theme-choices-chip-bg);
    border-color: var(--theme-choices-chip-border);
    border-radius: 0.75rem;
}

.choices__input {
    font-size: 1.15rem;
    background-color: transparent;
}

.choices[data-type*="select-multiple"] .choices__button,
.choices[data-type*="text"] .choices__button {
    filter: invert(1) brightness(2) contrast(10);
    border-left: 1px solid var(--theme-choices-close-border);
}

.choices__list--dropdown {
    border-radius: 1.25rem;
}

.choices__list--dropdown .choices__item {
    font-size: 1.15rem;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #f8f8f8;
    color: #3A3C42;
}

/* When dropdown is open - create seamless connection between field and dropdown */
/* Normal dropdown (opens downward) */
.choices.is-open:not(.is-flipped) .choices__inner {
    border-top-left-radius: 1.25rem !important;
    border-top-right-radius: 1.25rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.choices.is-open:not(.is-flipped) .choices__list--dropdown {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 1.25rem !important;
    border-bottom-right-radius: 1.25rem !important;
    margin-top: -1px;
}

/* Flipped dropdown (opens upward) */
.choices.is-open.is-flipped .choices__inner {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 1.25rem !important;
    border-bottom-right-radius: 1.25rem !important;
}

.choices.is-open.is-flipped .choices__list--dropdown {
    border-top-left-radius: 1.25rem !important;
    border-top-right-radius: 1.25rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-bottom: -1px;
}

.form-control.is-valid,
.custom-select.is-valid {
    border-color: #198754 !important;
    background-image: none !important;
}

.form-control.is-valid.api-valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(.375em + .1875rem) center !important;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem) !important;
}

.form-control.is-invalid,
.custom-select.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(.375em + .1875rem) center !important;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem) !important;
}

.choices.is-valid .choices__inner {
    border-color: #198754 !important;
}

.choices.is-invalid .choices__inner {
    border-color: #dc3545 !important;
}

.captcha-container {}

.captcha-image {
    height: 58px;
    width: 150px;
    border-radius: 1.25rem;
    background-color: #f8f8f8;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}

.captcha-container .custom-input {
    flex-grow: 1;
}

.btn-captcha-refresh {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 1.25rem;
    border: 1px solid #e5e7eb;
    background-color: #f8f8f8;
    color: var(--theme-header);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-captcha-refresh:hover {
    background-color: #e9ecef;
}

.btn-captcha-refresh:focus {
    box-shadow: 0 0 0 .2rem var(--theme-focus-shadow);
}

@media (min-width: 576px) {
    .header-flex {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2.5rem;
        gap: 0;
    }

    .logo {
        max-width: 180px;
    }

    h1.h3.header-title {
        font-size: 2.25rem;
    }
}

@keyframes form-error-blink {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }

    50% {
        box-shadow: 0 0 8px 2px rgba(220, 53, 69, 0.5);
    }
}

.is-invalid.animate-error {
    animation: form-error-blink 0.3s 2;
}

.choices.is-invalid.animate-error .choices__inner {
    animation: form-error-blink 0.3s 2;
}

/* Two-line select option styles for Choices.js */
.choices[data-type*="select-one"] .choices__inner {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

/* Placeholder styling for Choices.js - match other input placeholders */
.choices__placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Style for placeholder in CLOSED select (the visible button text when nothing selected) */
.choices__inner .choices__item[data-value=""],
.choices__inner .choices__item.is-placeholder {
    color: #9ca3af !important;
    font-size: 1.15rem !important;
    opacity: 1 !important;
}

/* Ensure selected items keep their normal color */
.choices__inner .choices__item:not([data-value=""]):not(.is-placeholder) {
    color: #3A3C42 !important;
}

/* Hide only placeholder from dropdown, disabled options should be visible as separators */
.choices__list--dropdown .choices__item[data-value=""] {
    display: none !important;
}

/* Title and subtitle in selected item (visible in the select button) */
.choices-item-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #3A3C42;
    line-height: 1.3;
}

.choices-item-subtitle {
    font-size: 0.90rem;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 2px;
}

/* Title and subtitle in dropdown options */
.choices__list--dropdown .choices-option-title {
    font-size: 1.10rem;
    font-weight: 600;
    color: #3A3C42;
    line-height: 1.4;
}

.choices__list--dropdown .choices-option-subtitle {
    font-size: 0.90rem;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 3px;
}

/* Hover and highlight states for dropdown */
.choices__list--dropdown .choices__item--selectable.is-highlighted .choices-option-title {
    color: #3A3C42;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted .choices-option-subtitle {
    color: #4b5563;
}

/* Disabled option styling */
.choices__list--dropdown .choices__item--disabled .choices-option-title {
    color: #9ca3af;
}

.choices__list--dropdown .choices__item--disabled .choices-option-subtitle {
    color: #d1d5db;
}

/* Adjust dropdown item padding for two-line options */
.choices__list--dropdown .choices__item:has(.choices-option-subtitle) {
    padding: 12px 16px;
}

/* Image and Cover field styles - match form aesthetics */
.image-field-container img,
.cover-field-container img {
    border-radius: 1.25rem;
}

.image-field-container .image-placeholder,
.cover-field-container .cover-placeholder {
    border-radius: 1.25rem;
    border: 1px solid #e5e7eb;
}

/* MeasureInfo field styles */
.measure-info-container {
    border-radius: 1.25rem;
}

.measure-info-container.card-bordered {
    border: 1px solid #e5e7eb;
    background-color: #fff;
    padding: 1.25rem;
}

.measure-info-container.card-filled {
    background-color: #f8f8f8;
    padding: 1.25rem;
}

.measure-info-container.card-minimal {
    padding: 0.5rem 0;
}

/* Название мероприятия - стиль как у Spacer Label */
.measure-info-title {
    margin-bottom: 0.75rem;
}

.measure-info-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.25rem;
}

.measure-info-row .measure-info-value {
    flex: 0 1 auto;
    text-align: left;
    max-width: 100%;
}

/* Mobile specific adjustment removed as default is now left aligned */

.measure-info-row:last-child {
    border-bottom: none;
}

.measure-info-label {
    color: #6b7280;
    font-size: 0.95rem;
}

.measure-info-value {
    font-weight: 500;
    color: #3A3C42;
    font-size: 0.95rem;
}