@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body.tops-modal-open {
    overflow: hidden;
}

.tops-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 20, 0.72);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tops-modal-backdrop.active {
    display: block;
    opacity: 1;
}

.tops-modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(calc(100vw - 32px), 460px);
    max-width: 100%;
    max-height: min(90vh, 760px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tops-modal-panel::-webkit-scrollbar {
    display: none;
}

.tops-modal-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.tops-modal-panel.tops-modal-panel-wide {
    width: min(calc(100vw - 32px), 520px);
}

.tops-glass-form {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 32px 28px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Poppins', sans-serif;
}

.tops-glass-form h2,
.tops-glass-form h3 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    margin-bottom: 18px;
    text-align: center;
    font-weight: 600;
    padding: 0 40px;
}

.tops-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tops-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tops-form-alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.tops-form-alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(255, 120, 120, 0.45);
    color: #ffe3e3;
}

.tops-form-alert-success {
    background: rgba(25, 135, 84, 0.22);
    border: 1px solid rgba(120, 255, 180, 0.35);
    color: #dfffea;
}

.tops-form-alert-warning {
    background: rgba(255, 193, 7, 0.18);
    border: 1px solid rgba(255, 220, 100, 0.4);
    color: #fff3cd;
}

.tops-glass-form .input-box {
    margin-bottom: 16px;
}

.tops-glass-form .input-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #ddd;
}

.tops-glass-form .input-box input:not([type="checkbox"]):not([type="radio"]),
.tops-glass-form .input-box select,
.tops-glass-form .input-box textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.tops-glass-form .input-box select {
    cursor: pointer;
}

.tops-glass-form .input-box select option {
    color: #111;
    background: #fff;
}

.tops-glass-form .input-box input.tops-input-readonly {
    cursor: default;
    pointer-events: none;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.tops-glass-form .input-box input:not([type="checkbox"]):not([type="radio"]):focus,
.tops-glass-form .input-box select:focus,
.tops-glass-form .input-box textarea:focus {
    border-color: rgba(200, 177, 255, 0.8);
    background: rgba(255, 255, 255, 0.2);
}

.tops-glass-form .input-box input::placeholder,
.tops-glass-form .input-box textarea::placeholder {
    color: #ccc;
}

.tops-form-note {
    margin-top: 8px;
    font-size: 12px;
    color: #bbb;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tops-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.tops-btn-primary,
.tops-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tops-btn-primary {
    flex: 1 1 140px;
    background: linear-gradient(to right, #7c5cff, #4422bb);
    color: #fff;
}

.tops-btn-secondary {
    flex: 1 1 120px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.tops-btn-primary:hover,
.tops-btn-secondary:hover {
    transform: translateY(-2px);
    color: #fff;
}

.tops-profile-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.tops-photo-circle-shell {
    display: flex;
    justify-content: center;
}

.tops-photo-circle-viewport {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.16);
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: default;
    touch-action: none;
}

.tops-photo-circle-viewport.is-editing {
    cursor: grab;
    border-color: rgba(255, 255, 255, 0.75);
}

.tops-photo-circle-viewport.is-editing:active {
    cursor: grabbing;
}

.tops-photo-circle-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    pointer-events: none;
}

.tops-photo-circle-image.is-editing {
    object-fit: unset;
    max-width: none;
    max-height: none;
}

.tops-photo-circle-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.tops-photo-circle-fallback img {
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.tops-photo-editor-help {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: rgba(255, 255, 255, 0.86);
}

.tops-photo-zoom-box input[type="range"] {
    width: 100%;
}

.tops-profile-photo-box .input-box {
    width: 100%;
}

.tops-profile-photo-box input[type="file"] {
    width: 100%;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
}

.tops-profile-photo-remove {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.tops-profile-photo-remove input {
    margin: 0;
}

.tops-photo-edit-btn {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.tops-photo-edit-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

@media (max-width: 768px) {
    .tops-modal-panel,
    .tops-modal-panel.tops-modal-panel-wide {
        width: calc(100vw - 24px);
    }

    .tops-glass-form {
        padding: 26px 18px 22px;
        border-radius: 18px;
    }

    .tops-form-actions:not(.tops-confirm-actions) {
        flex-direction: column;
    }

    .tops-form-actions:not(.tops-confirm-actions) .tops-btn-primary,
    .tops-form-actions:not(.tops-confirm-actions) .tops-btn-secondary,
    .tops-form-actions:not(.tops-confirm-actions) .tops-btn-danger {
        width: 100%;
    }
}

.tops-confirm-modal {
    width: min(calc(100vw - 32px), 420px);
    z-index: 2100;
}

#deleteConfirmBackdrop {
    z-index: 2099;
}

.tops-confirm-form {
    text-align: center;
    padding: 24px 22px 20px;
}

.tops-confirm-form h2 {
    font-size: 1.35rem;
    margin-bottom: 10px;
    padding: 0 28px;
}

.tops-confirm-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #ffd0d0;
    background: rgba(232, 69, 69, 0.2);
    border: 1px solid rgba(255, 120, 120, 0.35);
}

.tops-confirm-message {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 14px;
    line-height: 1.55;
}

.tops-confirm-actions {
    justify-content: center;
    gap: 10px;
    align-items: stretch;
}

.tops-confirm-actions .tops-btn-secondary,
.tops-confirm-actions .tops-btn-danger {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    max-height: 48px;
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 12px;
}

.tops-btn-danger {
    border: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(to right, #e84545, #b91c1c);
    color: #fff;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.tops-btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    color: #fff;
}

@media (max-width: 768px) {
    .tops-modal-panel.tops-confirm-modal {
        top: 50%;
        bottom: auto;
        left: 50%;
        right: auto;
        width: min(calc(100vw - 32px), 340px);
        max-width: calc(100vw - 32px);
        max-height: min(90vh, 420px);
        transform: translate(-50%, -50%) scale(0.96);
        border-radius: 20px;
    }

    .tops-modal-panel.tops-confirm-modal.active {
        transform: translate(-50%, -50%) scale(1);
    }

    .tops-confirm-modal .tops-glass-form,
    .tops-confirm-modal .tops-confirm-form {
        border-radius: 20px;
        padding: 22px 18px 18px;
    }

    .tops-confirm-modal .tops-confirm-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
        font-size: 20px;
    }

    .tops-confirm-modal .tops-confirm-form h2 {
        font-size: 1.1rem;
        margin-bottom: 6px;
        padding: 0 20px;
    }

    .tops-confirm-modal .tops-confirm-message {
        margin-bottom: 16px;
        font-size: 13px;
        padding: 0 4px;
    }

    .tops-confirm-modal .tops-confirm-actions {
        flex-direction: row;
        gap: 10px;
        margin-top: 4px;
    }

    .tops-confirm-modal .tops-confirm-actions .tops-btn-secondary,
    .tops-confirm-modal .tops-confirm-actions .tops-btn-danger {
        width: auto;
        flex: 1 1 0;
        min-height: 42px;
        max-height: 42px;
        padding: 0 12px;
        font-size: 15px;
    }

    .tops-confirm-modal .tops-modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}

.tops-field-hint {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
}

.tops-multiselect {
    position: relative;
    width: 100%;
}

.tops-multiselect-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tops-multiselect-trigger:hover {
    border-color: rgba(200, 177, 255, 0.55);
    background: rgba(255, 255, 255, 0.18);
}

.tops-multiselect.is-open .tops-multiselect-trigger {
    border-color: rgba(200, 177, 255, 0.85);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.tops-multiselect-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.58);
    font-size: 15px;
}

.tops-multiselect-value.has-value {
    color: #fff;
    font-weight: 500;
}

.tops-multiselect-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tops-multiselect.is-open .tops-multiselect-chevron {
    transform: rotate(-135deg) translateY(2px);
    border-color: rgba(200, 177, 255, 0.95);
}

.tops-multiselect-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(180, 160, 255, 0.22);
    background: linear-gradient(180deg, rgba(36, 22, 64, 0.98) 0%, rgba(24, 14, 46, 0.98) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tops-multiselect-menu::-webkit-scrollbar {
    display: none;
}

.tops-multiselect-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    height: 48px;
    padding: 10px 14px 0;
    margin: 0 0 4px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.tops-multiselect-option:last-child {
    margin-bottom: 0;
}

.tops-multiselect-option-all {
    position: relative;
    margin-top: 8px;
    background: rgba(124, 92, 255, 0.06);
}

.tops-multiselect-option-all::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.tops-multiselect-option:hover {
    background: rgba(124, 92, 255, 0.14);
    border-color: rgba(180, 160, 255, 0.18);
}

.tops-multiselect-option input[type="checkbox"],
.tops-multiselect-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    transform: translateY(3px);
}

.tops-multiselect-option input[type="checkbox"]:hover,
.tops-multiselect-option input[type="radio"]:hover {
    border-color: rgba(180, 160, 255, 0.65);
    background: rgba(124, 92, 255, 0.12);
}

.tops-multiselect-option input[type="checkbox"]:checked,
.tops-multiselect-option input[type="radio"]:checked {
    background: linear-gradient(135deg, #8b6cff 0%, #6d4dff 100%);
    border-color: #b4a0ff;
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.22);
}

.tops-multiselect-option input[type="checkbox"]:checked::after,
.tops-multiselect-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 10px;
    margin-left: -3px;
    margin-top: -6px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tops-glass-form .input-box .tops-multiselect-option input[type="checkbox"],
.tops-glass-form .input-box .tops-multiselect-option input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
}

.tops-multiselect-option-label {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0.01em;
    transform: translateY(3px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.88);
    transition: color 0.18s ease;
}

.tops-multiselect-option:has(input[type="checkbox"]:checked),
.tops-multiselect-option:has(input[type="radio"]:checked) {
    background: rgba(124, 92, 255, 0.2);
    border-color: rgba(180, 160, 255, 0.28);
}

.tops-multiselect-option:has(input[type="checkbox"]:checked) .tops-multiselect-option-label,
.tops-multiselect-option:has(input[type="radio"]:checked) .tops-multiselect-option-label {
    color: #fff;
    font-weight: 500;
}

.tops-multiselect-option-all:has(input:checked) {
    background: rgba(124, 92, 255, 0.26);
}

.tops-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tops-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.tops-checkbox-item input {
    accent-color: #7c5cff;
}

.tops-checkbox-item:has(input:checked) {
    background: rgba(124, 92, 255, 0.24);
    border-color: rgba(180, 160, 255, 0.35);
}
