.fx-edit-page * {
     box-sizing: border-box;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     color: #333;
     margin: 0;
     padding: 0;
 }

.fx-row a {
    color: #2a7ae2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.fx-form-page {
    margin: 0 auto;
    padding: 1em 1.5em;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgb(0 0 0 / 0.1);
}

/* Хединг */
.fx-heading {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 1.5em;
}

.fx-title {
    font-weight: 400;
    color: #0078d4;
}

.fx-separator {
    border: none;
    border-bottom: 1px solid #ddd;
    margin: 1em 0;
}

.fx-row {
    margin-bottom: 0.2em;
    display: flex;
    flex-direction: column;
}

.fx-row.select-row {
    display: flex;
    flex-direction: row;      /* <== вот эта строчка — ключевая */
    align-items: flex-start;  /* как у тебя */
    margin-bottom: 1.25em;
    justify-content: flex-start;
    align-items: center;      /* Центрирование по вертикали */
}


.fx-row.select-row .fx-label {
    flex-shrink: 0;
    width: 13em;
    text-align: left;
    padding-right: 0.5em;
    float: none !important;
    margin-bottom: 0 !important;
}

.fx-row.select-row .fx-input-wrapper {
    display: inline-flex;
    max-width: 100%;
    min-width: 150px;
}

.fx-row.select-row .fx-select {
    width: auto;
    min-width: 150px;
    max-width: 100%;
    box-sizing: border-box;
}

.fx-row-left {
    align-items: flex-start !important;
}

/* Стили для label (кроме чекбоксов) */
.fx-label {
    font-weight: 600;
    margin-bottom: 0.35em;
    cursor: pointer;
    float: left;
    width: 15em;
    text-align: left; /* оставлено как в твоём коде */
    padding-right: 0.5em;
}

.fx-label-left {
    width: 12em;
    padding-right: 0.5em;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    margin-bottom: 0;
    white-space: nowrap;

    /* отменяем float и прочее на случай наследования */
    float: none !important;
    clear: none !important;
}

.fx-terms-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5em 0 0 0;
}

.fx-terms-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.3em;
}

.fx-terms-icon {
    flex-shrink: 0;
    margin-right: 0.5em;
    color: #2a7ae2; /* цвет иконки, можно менять */
}

.fx-terms-list a {
    color: #2a7ae2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.fx-terms-list a:hover,
.fx-terms-list a:focus {
    color: #1a5bcc;
    text-decoration: underline;
}


/* Стили для чекбоксов и их label */
.fx-checkbox-wrapper label {
    cursor: pointer;
    user-select: none;
    margin-left: 0;
    line-height: 1.2;
    float: none !important;
    width: auto !important;
    text-align: left !important;
    padding-right: 0 !important;
}

.fx-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.fx-checkbox-wrapper input[type="checkbox"] {
    all: unset;
    width: 18px;
    height: 18px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin: 0;
    top: 0;
}

.fx-checkbox-wrapper input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #0078d4;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.fx-input,
.fx-select,
.fx-textarea {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    padding: 0.5em 0.75em;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.4;
    color: #222;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.fx-input--short {
    max-width: 300px;
}

.fx-input:focus,
.fx-select:focus,
.fx-textarea:focus {
    border-color: #0078d4;
    box-shadow: 0 0 6px #0078d4aa;
    outline: none;
}

.fx-select {
    cursor: pointer;
    appearance: none;
    background: white url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='14' height='10' viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect y='0' width='14' height='2' fill='%23333'/%3E%3Crect y='4' width='14' height='2' fill='%23333'/%3E%3Crect y='8' width='14' height='2' fill='%23333'/%3E%3C/svg%3E") no-repeat right 1em center / 14px 10px;
    padding-right: 2.5em; /* чтобы текст не налезал на гамбургер */
}

.fx-textarea {
    min-height: 250px;
    font-family: monospace;
    resize: vertical;
}

.fx-hint {
    font-size: 0.9rem;
    color: #555; /* мелкий и сероватый текст для подписей */
    margin-top: 0.3em;
    background-color: transparent; /* без фона */
    border: none; /* без рамок */
    padding: 0;
    box-shadow: none;
    line-height: 1.3;
}

.fx-notice {
    font-size: 12px;
    color: #444; /* чуть темнее для читаемости */
    margin-top: 0.5em;
    background-color: #fff9db; /* светлый кремово-жёлтый фон */
    border: 1px solid #f1e6a9; /* мягкая жёлтая рамка */
    padding: 1em 1.2em;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(241, 230, 169, 0.3); /* лёгкая мягкая тень */
    line-height: 1.4;
}


.fx-warning {
    color: #d93025;
    font-weight: 600;
}

.fx-required {
    color: #d93025;
    margin-left: 0.1em;
}

.fx-clear {
    clear: both;
}

.fx-edit-links a {
    color: #0078d4;
    text-decoration: none;
    margin-right: 0.75em;
    font-weight: 500;
}

.fx-edit-links a:hover {
    text-decoration: underline;
}

.fx-social-login-block {
    justify-content: center;
    align-items: center;
}

.fx-actions {
    justify-content: center;
    align-items: center;
    margin-top: 0.4em;
    display: flex;
    gap: 1em;
}

.fx-button {
    padding: 0.6em 1.3em;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    user-select: none;
    transition: background-color 0.3s ease;
}

.fx-button-primary {
    background-color: #0078d4;
    color: white;
    min-width: 230px;
}

.fx-button-primary:hover {
    background-color: #005a9e;
}

.fx-button-secondary {
    background-color: #e1e1e1;
    color: #333;
}

.fx-button-secondary:hover {
    background-color: #cfcfcf;
}

.fx-edit-page h6 a {
    display: inline-block;
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
    padding: 0.3em 0.8em;
    margin: 0.3em 0 0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.fx-edit-page h6 a:hover {
    background-color: #d5d5d5;
    color: #000;
}

.editable {
    white-space: pre-wrap;       /* перенос строк и пробелов */
    word-break: break-word;      /* перенос длинных слов */
    padding: 0.6em 0.5em;
    border: 3px solid #eee;
    border-radius: 4px;
    font-size: 22px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    min-height: 1.5em;           /* чтобы не был слишком маленьким */
    overflow: visible;           /* разрешить расти по высоте */
}

.editable:focus {
    border-color: #0078d4;
    box-shadow: 0 0 6px #0078d4aa;
}

.fx-form .__site-error-message {
    list-style: none;
    background-color: #ffe6e6;
    border: 1px solid #ff4d4d;
    color: #b30000;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 0.3em 0 0 0;  /* чуть сверху */
    font-size: 0.9rem;
    line-height: 1.3;
    box-shadow: none;
}

.fx-form .__site-error-message li {
    margin-bottom: 0.2em;
}

.fx-form .__site-error-message li:last-child {
    margin-bottom: 0;
}

#custom-dialog, #custom-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 320px;
    width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    z-index: 9999;
    text-align: center;
}

#custom-dialog-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

#custom-dialog-message,
#custom-confirm-message {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    font-size: 1rem;
    padding: 10px;
    box-sizing: border-box;
}

#custom-dialog-ok,
#custom-confirm-yes,
#custom-confirm-no {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 5px;
}

#custom-dialog-ok {
    background: #0078d4;
    color: #fff;
}

#custom-confirm-yes {
    background: #28a745;
    color: #fff;
}

#custom-confirm-no {
    background: #dc3545;
    color: #fff;
}

/* Кнопки выравниваем по центру и вниз */
.dialog-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#image-upload-loader .loader-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#image-upload-loader .loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease;
}

#image-upload-loader .loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.fx-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.fx-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.fx-radio input[type="radio"] {
    accent-color: #444; /* универсальный стиль */
    width: 16px;
    height: 16px;
    margin: 0;
}


#image-upload-loader .loader-text {
    font-size: 16px;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .fx-edit-page {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        max-width: 99vw;
        margin: 0 auto;
        background-color: #fff;
        border-radius: 0;       /* убираем скругления */
        box-shadow: none;       /* убираем тени */
    }

    .fx-form {
        padding: 1px;
        width: 99%;
        max-width: 99vw;
        box-sizing: border-box;
        margin: 0 auto;
        border-radius: 0;       /* убираем скругления */
        box-shadow: none;       /* убираем тени */
    }

    .editable {
        padding: 0.4em 0.5em;
        border: 2px solid #eee;
        font-size: 18px;
    }

    .fx-heading {
        font-size: 0.85rem;
        margin-bottom: 1em;
    }

    .fx-title {
        font-size: 20px;
    }

    .fx-row {
        flex-direction: column !important;
        margin-bottom: 0.2em;
    }

    .fx-row.select-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .fx-row.select-row .fx-label {
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 0.5em !important;
        text-align: left;
    }

    .fx-row.select-row .fx-input-wrapper {
        width: 100% !important;
        min-width: auto !important;
    }

    .fx-select,
    .fx-input,
    .fx-textarea {
        width: 100% !important;
        min-width: auto !important;
        font-size: 1rem;
        box-sizing: border-box;
    }

    .fx-checkbox-wrapper {
        margin-left: 0;
        gap: 0.5em;
        flex-wrap: nowrap;
    }

    .fx-checkbox-wrapper label {
        font-size: 1rem;
    }

    .fx-hint,
    .fx-notice {
        font-size: 0.7rem;
        padding: 0.2em;
    }

    h6 a {
        display: inline-block;
        padding: 0.4em 1em;
        font-size: 1rem;
    }

    .fx-actions {
        flex-direction: column;
        gap: 0.75em;
    }

    .fx-button {
        padding: 0.8em;
        font-size: 1.1rem;
        box-sizing: border-box;
    }
}

/* Общие стили для всех input-ов с иконками */
.fx-input-ico {
    background-repeat: no-repeat;
    background-position: 0.75em center;
    background-size: 1.1em;
    padding-left: 2.5em;
}

/* Индивидуальные иконки */
.fx-login-ico {
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v1.2h19.2v-1.2c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E");
}

.fx-password-ico {
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7a5 5 0 0 0-10 0v2H5v13h14V9h-2zM9 7a3 3 0 0 1 6 0v2H9V7zm3 11a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z'/%3E%3C/svg%3E");
}

.fx-password {
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7a5 5 0 0 0-10 0v2H5v13h14V9h-2zM9 7a3 3 0 0 1 6 0v2H9V7zm3 11a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z'/%3E%3C/svg%3E");
    padding-right: 1.6em !important;
}

.fx-confirm-ico {
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6V3L8 7l4 4V8c2.76 0 5 2.24 5 5 0 1.2-.42 2.3-1.11 3.17l1.46 1.46C18.23 16.52 19 14.85 19 13c0-3.87-3.13-7-7-7zm-5.41.59L5.13 8.05C3.77 9.48 3 11.15 3 13c0 3.87 3.13 7 7 7v3l4-4-4-4v3c-2.76 0-5-2.24-5-5 0-1.2.42-2.3 1.11-3.17z'/%3E%3C/svg%3E");
}

.fx-email-ico {
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 2v.01L12 13 4 6.01V6h16zM4 18V8l8 5 8-5v10H4z'/%3E%3C/svg%3E");
}

.fx-input-wrapper.fx-password-wrapper {
    position: relative;
}

.fx-input-floating-label {
    width: 100%;
    padding: 1em 0.6em 1em 2.5em; /* padding-left 2.5em из-за иконки */
    font-size: 1em;
    text-align: left !important;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: left;
}

.fx-floating-label {
    position: absolute;
    top: 1.2em;
    left: 2.5em !important;
    color: #999;
    font-size: 1em;
    pointer-events: none;
    background: transparent;
    padding: 0 0.2em;
    white-space: nowrap;
    transition: 0.2s ease all;
    text-align: left !important;
    width: 100px;
}

.fx-input-floating-label:focus + .fx-floating-label,
.fx-input-floating-label:not(:placeholder-shown) + .fx-floating-label {
    top: 0.2em;
    font-size: 0.75em;
    color: #555;
    left: 0.6em !important;
}

.fx-star {
    color: #d93025;
    margin-left: 0.1em;
    font-weight: 600;
    vertical-align: middle;
    font-size: 28px;
    position: relative;
    top: 3px;
}

#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #999;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.overlay-text {
    font-size: 1.2em;
    color: #333;
    font-weight: 400;
}

.fx-input-row {
    display: inline-flex;        /* сжимается по содержимому */
    align-items: center;
    flex-direction: row;
    max-width: 100%;             /* чтобы не выходил за родителя */
    flex-direction: column !important;
}

.fx-input-row .fx-input-wrapper {
    width: 100%;                /* занимает всю ширину контейнера */
    max-width: 300px;           /* или любая желаемая максимальная ширина */
    box-sizing: border-box;     /* обязательно для правильной ширины */
}

.fx-password-wrapper {
    position: relative;
    width: 100%;
    max-width: none; /* убираем ограничение */
}

.fx-password-wrapper .fx-input {
    width: 100% !important;
    padding-right: 2.5em !important;
    box-sizing: border-box !important;
}

.fx-password-wrapper .fx-toggle-password {
    position: absolute !important;
    top: 50% !important;
    right: 0.6em !important;
    transform: translateY(-50%) !important;
    width: 1.5em !important;
    height: 1.5em !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    opacity: 0.6 !important;
    background-image: url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 13c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zm0-10a4 4 0 1 0 0 8 4 4 0 0 0 0-8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 1.3em !important;
    transition: opacity 0.2s ease !important;
    z-index: 10 !important;
}

.fx-password-wrapper .fx-toggle-password:hover {
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .fx-form-page {
        width: 99%;           /* почти вся ширина экрана */
        max-width: none;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0.4em;
        padding-right: 0.4em;
    }

    .fx-radio-group {
        display: flex;
        flex-direction: row;
        gap: 6px;
        margin-top: 4px;
    }

    .fx-password-wrapper .fx-input {
        width: 300px !important;
    }

    .fx-submit {
        margin-bottom: 5px;
    }

    .fx-row-radio-group {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .fx-input,
    .fx-select,
    .fx-textarea {
        padding: 0.6em 0.75em; /* увеличено */
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .fx-button {
        padding: 0.6em 1.1em;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .fx-label,
    .fx-label-left,
    .fx-row.select-row .fx-label {
        font-size: 0.65rem;
        margin-bottom: 0.2em;
    }

    .fx-floating-label {
        font-size: 0.75em;
        top: 1.2em; /* было 0.9em — подняли выше */
        left: 3em;
    }

    .fx-input-floating-label:focus + .fx-floating-label,
    .fx-input-floating-label:not(:placeholder-shown) + .fx-floating-label {
        top: 0.1em;
        font-size: 0.45em;
        color: #555;
        left: 1.6em !important;
    }

    .fx-input-floating-label {
        padding: 1.2em 0.6em 0.6em 2em; /* увеличили верхний паддинг */
        font-size: 1rem;
    }

    .fx-textarea {
        min-height: 180px;
    }

    .fx-hint,
    .fx-notice {
        font-size: 0.7rem;
        padding: 0.2em;
    }

    .fx-edit-links a {
        font-size: 0.75rem;
        padding: 0.3em 0.6em;
    }

    .fx-checkbox-wrapper label {
        font-size: 0.75rem;
    }

    .fx-radio {
        font-size: 0.75rem;
    }

    .editable {
        padding: 0.5em 0.6em;
        font-size: 1rem;
    }

    .fx-form .__site-error-message {
        font-size: 0.8rem;
        padding: 0.4em 0.6em;
    }

    .fx-form .__site-error-message li {
        margin-bottom: 0.1em;
    }

    .overlay-text {
        font-size: 1rem;
    }

    .fx-additional-data {
        display: none;
    }

}

.fx-row {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.fx-input {
    width: 100%;
}

.fx-input input {
    width: 100%;
    box-sizing: border-box;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    font-family: sans-serif;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 4px;
}

.custom-select-arrow {
    margin-left: 10px;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
    display: none;
}

.custom-option {
    padding: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-option:hover {
    background: #eee;
}

.custom-option .icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.lock-icon {
    background: url('data:image/svg+xml;utf8,<svg fill="%23000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 8V6a5 5 0 0 0-10 0v2H5v14h14V8h-2zm-8 0V6a3 3 0 0 1 6 0v2H9z"/></svg>') no-repeat center center;
    background-size: contain;
}

.custom-select-wrapper.open .custom-options {
    display: block;
}











